Changing VS.NET defaults

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Fox

    #1

    Changing VS.NET defaults

    Hello,

    When you add a new web form in VS.NET it
    automatically adds the following namespaces at the top:

    using System;
    using System.Collecti ons;
    using System.Componen tModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.Sess ionState;
    using System.Web.UI;
    using System.Web.UI.W ebControls;
    using System.Web.UI.H tmlControls;

    is there a way to make it so that VS.NET also
    automatically includes

    using System.Data.Sql Client;

    ? Thanks!
  • Mark Heimonen

    #2
    Re: Changing VS.NET defaults

    Right click on the project in "Solution Explorer". Select Properties. Then
    go to the "Imports" tab, and add system.data.sql client.

    "Mark Fox" <info@solelsoft ware.com> wrote in message
    news:0d3901c357 6c$05a7bfb0$a40 1280a@phx.gbl.. .[color=blue]
    > Hello,
    >
    > When you add a new web form in VS.NET it
    > automatically adds the following namespaces at the top:
    >
    > using System;
    > using System.Collecti ons;
    > using System.Componen tModel;
    > using System.Data;
    > using System.Drawing;
    > using System.Web;
    > using System.Web.Sess ionState;
    > using System.Web.UI;
    > using System.Web.UI.W ebControls;
    > using System.Web.UI.H tmlControls;
    >
    > is there a way to make it so that VS.NET also
    > automatically includes
    >
    > using System.Data.Sql Client;
    >
    > ? Thanks![/color]


    Comment

    • Mark Heimonen

      #3
      Re: Changing VS.NET defaults

      Never mind. This option is only available for VB projects. In C#, it is on
      the same dialog, on the left side, select the "Common Properties" folder,
      and then select "References Path".

      I'm using VS 2002

      "George Ter-Saakov" <we@hotmail.com > wrote in message
      news:uv3mGI3VDH A.2268@TK2MSFTN GP11.phx.gbl...[color=blue]
      > What version of VS are you using?
      >
      >
      > I can not find this tab in my VS 2003. Version 7.1.3088
      >
      > Thanks,
      > George.
      >
      >
      > "Mark Heimonen" <markh@adiaim.c om> wrote in message
      > news:uo7Hb32VDH A.1052@TK2MSFTN GP09.phx.gbl...[color=green]
      > > Right click on the project in "Solution Explorer". Select Properties.[/color]
      > Then[color=green]
      > > go to the "Imports" tab, and add system.data.sql client.
      > >
      > > "Mark Fox" <info@solelsoft ware.com> wrote in message
      > > news:0d3901c357 6c$05a7bfb0$a40 1280a@phx.gbl.. .[color=darkred]
      > > > Hello,
      > > >
      > > > When you add a new web form in VS.NET it
      > > > automatically adds the following namespaces at the top:
      > > >
      > > > using System;
      > > > using System.Collecti ons;
      > > > using System.Componen tModel;
      > > > using System.Data;
      > > > using System.Drawing;
      > > > using System.Web;
      > > > using System.Web.Sess ionState;
      > > > using System.Web.UI;
      > > > using System.Web.UI.W ebControls;
      > > > using System.Web.UI.H tmlControls;
      > > >
      > > > is there a way to make it so that VS.NET also
      > > > automatically includes
      > > >
      > > > using System.Data.Sql Client;
      > > >
      > > > ? Thanks![/color]
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • George Ter-Saakov

        #4
        Re: Changing VS.NET defaults

        Thanks.
        But I probably misunderstood. I thought it would add automatically using
        directives to the source.

        George.

        "Mark Heimonen" <markh@adiaim.c om> wrote in message
        news:uT7cON3VDH A.1748@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Never mind. This option is only available for VB projects. In C#, it is[/color]
        on[color=blue]
        > the same dialog, on the left side, select the "Common Properties" folder,
        > and then select "References Path".
        >
        > I'm using VS 2002
        >
        > "George Ter-Saakov" <we@hotmail.com > wrote in message
        > news:uv3mGI3VDH A.2268@TK2MSFTN GP11.phx.gbl...[color=green]
        > > What version of VS are you using?
        > >
        > >
        > > I can not find this tab in my VS 2003. Version 7.1.3088
        > >
        > > Thanks,
        > > George.
        > >
        > >
        > > "Mark Heimonen" <markh@adiaim.c om> wrote in message
        > > news:uo7Hb32VDH A.1052@TK2MSFTN GP09.phx.gbl...[color=darkred]
        > > > Right click on the project in "Solution Explorer". Select Properties.[/color]
        > > Then[color=darkred]
        > > > go to the "Imports" tab, and add system.data.sql client.
        > > >
        > > > "Mark Fox" <info@solelsoft ware.com> wrote in message
        > > > news:0d3901c357 6c$05a7bfb0$a40 1280a@phx.gbl.. .
        > > > > Hello,
        > > > >
        > > > > When you add a new web form in VS.NET it
        > > > > automatically adds the following namespaces at the top:
        > > > >
        > > > > using System;
        > > > > using System.Collecti ons;
        > > > > using System.Componen tModel;
        > > > > using System.Data;
        > > > > using System.Drawing;
        > > > > using System.Web;
        > > > > using System.Web.Sess ionState;
        > > > > using System.Web.UI;
        > > > > using System.Web.UI.W ebControls;
        > > > > using System.Web.UI.H tmlControls;
        > > > >
        > > > > is there a way to make it so that VS.NET also
        > > > > automatically includes
        > > > >
        > > > > using System.Data.Sql Client;
        > > > >
        > > > > ? Thanks!
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Mark Heimonen

          #5
          Re: Changing VS.NET defaults

          Sorry, I guess C# doesn't have the same ability on this dialog. In VB.NET,
          it doesn't actually add the statements, but it uses the imports when
          compiling your project.

          "George Ter-Saakov" <we@hotmail.com > wrote in message
          news:%23I7$LR3V DHA.3376@tk2msf tngp13.phx.gbl. ..[color=blue]
          > Thanks.
          > But I probably misunderstood. I thought it would add automatically using
          > directives to the source.
          >
          > George.
          >
          > "Mark Heimonen" <markh@adiaim.c om> wrote in message
          > news:uT7cON3VDH A.1748@TK2MSFTN GP12.phx.gbl...[color=green]
          > > Never mind. This option is only available for VB projects. In C#, it[/color][/color]
          is[color=blue]
          > on[color=green]
          > > the same dialog, on the left side, select the "Common Properties"[/color][/color]
          folder,[color=blue][color=green]
          > > and then select "References Path".
          > >
          > > I'm using VS 2002
          > >
          > > "George Ter-Saakov" <we@hotmail.com > wrote in message
          > > news:uv3mGI3VDH A.2268@TK2MSFTN GP11.phx.gbl...[color=darkred]
          > > > What version of VS are you using?
          > > >
          > > >
          > > > I can not find this tab in my VS 2003. Version 7.1.3088
          > > >
          > > > Thanks,
          > > > George.
          > > >
          > > >
          > > > "Mark Heimonen" <markh@adiaim.c om> wrote in message
          > > > news:uo7Hb32VDH A.1052@TK2MSFTN GP09.phx.gbl...
          > > > > Right click on the project in "Solution Explorer". Select[/color][/color][/color]
          Properties.[color=blue][color=green][color=darkred]
          > > > Then
          > > > > go to the "Imports" tab, and add system.data.sql client.
          > > > >
          > > > > "Mark Fox" <info@solelsoft ware.com> wrote in message
          > > > > news:0d3901c357 6c$05a7bfb0$a40 1280a@phx.gbl.. .
          > > > > > Hello,
          > > > > >
          > > > > > When you add a new web form in VS.NET it
          > > > > > automatically adds the following namespaces at the top:
          > > > > >
          > > > > > using System;
          > > > > > using System.Collecti ons;
          > > > > > using System.Componen tModel;
          > > > > > using System.Data;
          > > > > > using System.Drawing;
          > > > > > using System.Web;
          > > > > > using System.Web.Sess ionState;
          > > > > > using System.Web.UI;
          > > > > > using System.Web.UI.W ebControls;
          > > > > > using System.Web.UI.H tmlControls;
          > > > > >
          > > > > > is there a way to make it so that VS.NET also
          > > > > > automatically includes
          > > > > >
          > > > > > using System.Data.Sql Client;
          > > > > >
          > > > > > ? Thanks!
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Yan-Hong Huang[MSFT]

            #6
            Re: Changing VS.NET defaults

            Hello Mark,

            I am glad you have found the right info already. Just a supplement that we could also add files to in this folder to add
            template for ourselves.

            Thanks very much for participating the community.

            Best regards,
            Yanhong Huang
            Microsoft Online Partner Support

            Get Secure! - www.microsoft.com/security
            This posting is provided "AS IS" with no warranties, and confers no rights.

            --------------------
            !Content-Class: urn:content-classes:message
            !From: "Mark Fox" <info@solelsoft ware.com>
            !Sender: "Mark Fox" <info@solelsoft ware.com>
            !References: <0d3901c3576c$0 5a7bfb0$a401280 a@phx.gbl> <uo7Hb32VDHA.10 52@TK2MSFTNGP09 .phx.gbl>
            <uv3mGI3VDHA.22 68@TK2MSFTNGP11 .phx.gbl> <uT7cON3VDHA.17 48@TK2MSFTNGP12 .phx.gbl> <5c6101c35779
            $6a914330$a0012 80a@phx.gbl>
            !Subject: Re: Changing VS.NET defaults
            !Date: Thu, 31 Jul 2003 08:45:17 -0700
            !Lines: 91
            !Message-ID: <01a501c3577a$b d7abcb0$a101280 a@phx.gbl>
            !MIME-Version: 1.0
            !Content-Type: text/plain;
            ! charset="iso-8859-1"
            !Content-Transfer-Encoding: 7bit
            !X-Newsreader: Microsoft CDO for Windows 2000
            !X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
            !Thread-Index: AcNXer16fxcY0K+ URpir+JQ/7ZuU5g==
            !Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
            !Path: cpmsftngxa06.ph x.gbl
            !Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1638 15
            !NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
            !X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
            !
            !Nevermind. I found the template I have to change. It's
            !in
            !
            !C:\Program Files\Microsoft Visual
            !Studio .NET\VC#\Design erTemplates\103 3
            !
            !You could change any of the default templates there.
            !
            !The VB templates are in
            !
            !C:\Program Files\Microsoft Visual Studio .NET\Vb7
            !\DesignerTempl ates
            !
            !
            !>-----Original Message-----
            !>Mark,
            !>
            !> I added System.Data.Sql Client to the references
            !>path, but when I went and added a new web form to the
            !>project it didn't automatically add it to the using
            !>section at the top. Is there a template file somewhere
            !>(the analogy to Normal.dot for Word) that I should
            !modify
            !>to change the default template for new web form files?
            !>Thanks for your help?
            !>
            !>>-----Original Message-----
            !>>Never mind. This option is only available for VB
            !>projects. In C#, it is on
            !>>the same dialog, on the left side, select the "Common
            !>Properties" folder,
            !>>and then select "References Path".
            !>>
            !>>I'm using VS 2002
            !>>
            !>>"George Ter-Saakov" <we@hotmail.com > wrote in message
            !>>news:uv3mGI3 VDHA.2268@TK2MS FTNGP11.phx.gbl ...
            !>>> What version of VS are you using?
            !>>>
            !>>>
            !>>> I can not find this tab in my VS 2003. Version
            !7.1.3088
            !>>>
            !>>> Thanks,
            !>>> George.
            !>>>
            !>>>
            !>>> "Mark Heimonen" <markh@adiaim.c om> wrote in message
            !>>> news:uo7Hb32VDH A.1052@TK2MSFTN GP09.phx.gbl...
            !>>> > Right click on the project in "Solution Explorer".
            !>Select Properties.
            !>>> Then
            !>>> > go to the "Imports" tab, and add
            !>system.data.s qlclient.
            !>>> >
            !>>> > "Mark Fox" <info@solelsoft ware.com> wrote in message
            !>>> > news:0d3901c357 6c$05a7bfb0$a40 1280a@phx.gbl.. .
            !>>> > > Hello,
            !>>> > >
            !>>> > > When you add a new web form in VS.NET it
            !>>> > > automatically adds the following namespaces at
            !the
            !>top:
            !>>> > >
            !>>> > > using System;
            !>>> > > using System.Collecti ons;
            !>>> > > using System.Componen tModel;
            !>>> > > using System.Data;
            !>>> > > using System.Drawing;
            !>>> > > using System.Web;
            !>>> > > using System.Web.Sess ionState;
            !>>> > > using System.Web.UI;
            !>>> > > using System.Web.UI.W ebControls;
            !>>> > > using System.Web.UI.H tmlControls;
            !>>> > >
            !>>> > > is there a way to make it so that VS.NET also
            !>>> > > automatically includes
            !>>> > >
            !>>> > > using System.Data.Sql Client;
            !>>> > >
            !>>> > > ? Thanks!
            !>>> >
            !>>> >
            !>>>
            !>>>
            !>>
            !>>
            !>>.
            !>>
            !>.
            !>
            !


            Comment

            Working...