I am surprised how many people still don't know they can alias namespaces using the C# keyword using. Resharper automatically adds this syntax for me and it seems like 1 person a month says that didn't know. 1: using Short = Company.Project.Task.Function;
The ...
[More]
Currently rated 5.0 by 2 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
SQL Server 2005 provides a mechanism called CTE or Common Table Expressions for pre-loading data or setting up for later use. It is really fast compared to pre-2005 which did not have such a feature. To illustrate I'll take some hierarchical data and load it into a CTE. This would be a ...
[More]
Currently rated 5.0 by 1 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
Let's say you have a generic class with a new() constraint on the type parameter. This means that you are allowed to create new objects of the generic type, like this: 1: class GenericClass<T> where T : new()
2: {
3: public void SomeMethod()
4...
[More]
Currently rated 5.0 by 3 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
The Visual Studio Solution Explorer can become difficult to navigate when a solution becomes quite large. I have used a tool for some time now called SonicFileFinder. It has become one of my favorite utilities. SonicFileFinder is a free add-in for Visual Studio that allows a fast and...
[More]
Currently rated 5.0 by 3 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
I am a big fan of Resharper. It helps me be more productive and that is better for me and my company. One thing Resharper does is line highlighting in your IDE. So whatever line you are on will stand out. But I decided to try a dark theme with Visual Studio recently and I c...
[More]
Currently rated 5.0 by 3 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
Do you use database projects in Visual Studio? If not, then now is a good time to start. It is the best way I have found to source control my databases without actually sticking the database file itself in the repository. It is very simple to add to your solution and creates a default directory structure for your create scripts, change scripts and queries. Best of all the project will be recognized by source control and added to the source code repository. This means you can keep versioned scripts for maintainability. It also gives you the option to do the dreaded rollback!.
[More]
Currently rated 5.0 by 4 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
I am just putting some of my regular expressions here so that I can view it later. So no one should care about this post at all! :) In Visual Studio I needed to find every single line comment which also included the word IsNew in it. ^\s*//.*IsNew.*$ This will match from the...
[More]
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5
When you want to debug a windows service using the Visual Studio IDE you can either attach to the process which isn't fun after 5 minutes or you can do the following. Create a Visual Studio Solution Let's start by creating a new Visual Studio Solution named "EmailProcessor Solution"....
[More]
Currently rated 4.0 by 2 people
- Currently 4/5 Stars.
- 1
- 2
- 3
- 4
- 5
Here is a Generic Singleton factory. Enjoy!// this is the class for which I want to maintain a single instancepublic class MyClass{ private MyClass() { // private constructor ensures that callers cannot instantiate an object using new() }}// Singleton factory implementationpub...
[More]
Currently rated 5.0 by 1 people
- Currently 5/5 Stars.
- 1
- 2
- 3
- 4
- 5
This is a simple way of escaping special characters inside of strings that you might want to insert into XML. I have used other techniques which require more coding so keep this handy! You will use the following method: SecurityElement.Escape(string text). see MSDN documentation
Currently rated 4.0 by 2 people
- Currently 4/5 Stars.
- 1
- 2
- 3
- 4
- 5