Free Visual Studio Standard Edition
For a limited time, if you watch 2 Labcasts by Microsoft (90 minutes each), you can get a free licensed version of Visual Studio Standard Edition. Offer only applies in USA and expires June 30, 2007.
How to use SqlDataReader Plus Source Code
SqlDataReader can be used if you want to keep an open connection to the database and use the rows as they come to you (forward only stream of data). With SqlDataReader, you get the rows as they come, which can be handy if there is a lot of rows (say, millions), or if you have some sort of parallel processing you want to do while the data is still coming.
Proper use of global:: (or Global.)
The C# global:: keyword (Global. in VB.NET) allows developers to differentiate between conflicting namespaces and classes.
Efficiency of DataColumnCollection.Contains
The runtime complexity of DataColumnCollection.Contains is O(1) for case sensitive lookup ,and O(n) for case insensitive lookup. O(1) means constant time, i.e. it is done same speed regardless of whether the dataset size is 10, or 10,000,000 records, and O(n) means it will run in a speed to the size proportional to the data you are running it on.
How To Isolate Code To Run only on Certain Servers
Occasionally with websites, the need arises to have a block of code that executes only on a particular set of servers–whether local development servers, or client servers, or production servers. In particular, you may find this useful if you have code you want to run only on development servers. How, then, can you accomplish this?
Use Enum (C#) instead of magic numbers
Enumerations (enums) make your code much more readable and understandable. How to use enums to enrich your code. Includes C# and VB.NET enum example
Proper Use of Static Functions
A static function is static because you do not need to create an instance of the class in order to use it. Some popular static functions are located in the Math library, for example, Math.Min(x,y). Your class or function can be static when it has no need for class or member variables, and it is also compact and stateless. Don’t forget, you have to still consider thread safety!
Visual SourceSafe 2005 Tip (VS2005) – Keywords
Using Visual SourceSafe, we can put some text at the top of our source file and it will automatically be updated by SourceSafe when you check in the file. See below for an example. // Last updated by: // $Author: Sameera $ // $Date: 4/13/07 11:16a $ This will allow you to quickly see who [...]
HttpContext Can Break Object Oriented Principles
How incorrect use of HttpContext can break object oriented principles and how to fix it.
.NET Predicates (and a .RemoveAll() example)
What is a .NET Predicate and a C# example on how to use it.