Archive for the ‘C#’ Category
Thursday, November 19th, 2009
A summary of streams in .NET.
TextReader [abstract]
-----> StringReader
-----> StreamReader
TextWriter [abstract]
-----> StringWriter (uses underlying StringBuilder)
-----> StreamWriter
Posted in ASP.NET C#, C# | No Comments »
Tuesday, November 10th, 2009
Having begun programming with ASP.NET from its inception where you wrote your own solutions to common problems, I've found the introduction of ObjectDataSource objects and similar functionality a blessing and a curse. Although they can save a bit of coding I always find my self wasting lots of time trying ...
Posted in ASP.NET C#, C# | No Comments »
Tuesday, June 30th, 2009
Every time I need to parse a URL or to extract parts of a URL in ASP.NET C# I can never remember what I did last time and need to refer to the documentation. So, in order to quickly answer the question "How can I get the elements of a ...
Posted in ASP.NET C#, C#, HTML | No Comments »
Monday, June 22nd, 2009
I recently needed to do a WHERE X IN () style query using LINQ to SQL. Here's the solution I used:
Posted in ASP.NET C#, C#, LINQ TO SQL, SQL Server | No Comments »
Monday, June 8th, 2009
Extension methods enable you to "add" methods to existing types without creating a new derived type, recompiling, or otherwise modifying the original type. Extension methods are a special kind of static method, but they are called as if they were instance methods on the extended type. For client code written ...
Posted in ASP.NET C#, C# | No Comments »
Monday, June 8th, 2009
The yield keyword signals to the compiler that the method in which it appears is an iterator block. The compiler generates a class to implement the behavior that is expressed in the iterator block. In the iterator block, the yield keyword is used together with the return keyword to provide ...
Posted in ASP.NET C#, C#, Uncategorized | No Comments »