Category Archives: C#

How To Programmatically Flush log4net Message Buffer

If you have set a buffer size on one or more of your log4net appenders, the logger will buffer the messages before dumping them, for instance, into a file or a database. That optimizes the performance but what if you … Read More »»»

Posted in C# | Tagged , , , , , , , , | Leave a comment

How To Launch Your Console Application With A Maximized Window

Forgetting your old school CGA, EGA and then VGA displays of rich 8-bit color, 80×25 displays, we now can have all that screen in a console application, all in a window. A console window you can resize, minimize or maximize … Read More »»»

Posted in .NET, C#, Coding, System | Tagged , , , , , | Leave a comment

Domain Objects with Circular or Backwards References In C#, Serialization via JSON and Getting Them Across the Wire

There are always times when your child DOM object references a parent object that contains a list of them children DOM objects that, of have a parent, creating a rather nasty but simply to solve dilemma of circular reference. I’ll … Read More »»»

Posted in C# | Tagged , , , , , , , , , | Leave a comment

New Features of C# 6 You May Find Quite Useful

C# version 6 came out with the release of Visual Studio 2015. It includes quite a few useful features for the developers. Here is a list of the ones that will make a day for any developer who has been writing … Read More »»»

Posted in C# | Tagged , , , , , , , | Leave a comment

Just Young Is C# 6, And Here Comes C#7! What is New in C# 7 and What To Expect?

It has not been long since C# 6 release with a few useful improvements, and here comes C# 7 – excited yet?! Watch your recliner and read on: Tuples I have not used that much so please go ahead and … Read More »»»

Posted in C# | Tagged , , , , , , | Leave a comment

Create a SQL CLR Stored Procedure Using .NET (C# Example)

T-SQL is limited in its functions and getting the results you need sometimes becomes very complex and the statements used consequently hard to decipher. With SQL Server 2005, Microsoft introduced CLR (Common Language Runtime) technology which allows you to use … Read More »»»

Posted in C# | Tagged , , , , , , , , , , , , | Leave a comment

How Can I Use a LINQ Lambda Expression With Distinct()?

Contrary to what most of other LINQ extension methods provide when dealing with collections of objects, the Distinct() method takes in an object of a class that implements IEqualityComparer<T> interface. When selecting distinct objects, you probably are thinking about having … Read More »»»

Posted in C#, LINQ | Tagged , , , , , , | Leave a comment

How to Deserialize Objects That Are Stored in a Database as XML

You can serialize objects and store them in a database using the .NET framework. How do you get them back, then? – It is a rather straight-forward code. I’m going to utilize the same example classes I used in the … Read More »»»

Posted in C# | Tagged , , , , , , , , , | Leave a comment

How to Persist (Store) Objects in a Database Using Serialization in .NET

Once in a while, you need to persists your objects, that is store them for later use, be it for use across multiple applications or a single application. .NET provides a serialization mechanism for achieving this. So, let’s start off … Read More »»»

Posted in C# | Tagged , , , , , , , , , , | 1 Comment

Converting a String into an Enum Variable and Vise Versa

Sometimes you come across situations when you would want to convert an enum variable to a string. For instance, you might want to store it in a database as a string. This is, of course, very easy to do, given … Read More »»»

Posted in C# | Tagged , , , , , , | Leave a comment