I need to add this namespace to my c# file:
using System.Data;
Is there a way to automatically add this to newly created pages in c#.net?
I don't want to add this namespace to new pages.
Open %Program Files%\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033\Class.zip, Or: %Program Files%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Code\1033
You can modify the class.cs file within that's used to generate all new C# source files - it looks like this:
using System;
using System.Collections.Generic;
using System.Text;
namespace $rootnamespace$
{
    class $safeitemrootname$
    {
    }
}
Also, there is a file called Class.vstemplate. Open this and you can edit the following:
<Reference>
    <Assembly>System</Assembly>
        </Reference>
        <Reference>
            <Assembly>System.Data</Assembly>
        </Reference>
        <Reference>
            <Assembly>System.Xml</Assembly>
        </Reference>
    </References>
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With