Changing VS.NET defaults

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;

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

    using System.Data.SqlClient;

    ? Thanks!
    Mark Fox Guest

  2. Similar Questions and Discussions

    1. Connection defaults
      Hi everyone, I'm wondering if there's a way to change the default settings that are placed upon a new connection? Is it possible to write a script...
    2. Customization of defaults
      Hi everyone, Since it gets tedious going through the same procedure to set up a site's connection, that being more or less checking boxes...
    3. Dynamically changing server control defaults
      We are building a web application that allow's the users to change the defaults of a their pages. Here is a list of what I've done so far 1.)...
    4. Stroke Defaults
      Is it possible to add stroke sizes to the drop down menu of defaults? I'm working on diagrams that use .7pt strokes and 1.3pt strokes for most of the...
    5. save for web defaults
      Hello to all. When I select "save for web" in ps701, the default tool selected is the slice selection tool instead of the hand tool. Anyone know...
  3. #2

    Default 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.sqlclient.

    "Mark Fox" <info@solelsoftware.com> wrote in message
    news:0d3901c3576c$05a7bfb0$a401280a@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.Collections;
    > using System.ComponentModel;
    > using System.Data;
    > using System.Drawing;
    > using System.Web;
    > using System.Web.SessionState;
    > using System.Web.UI;
    > using System.Web.UI.WebControls;
    > using System.Web.UI.HtmlControls;
    >
    > is there a way to make it so that VS.NET also
    > automatically includes
    >
    > using System.Data.SqlClient;
    >
    > ? Thanks!

    Mark Heimonen Guest

  4. #3

    Default 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:uv3mGI3VDHA.2268@TK2MSFTNGP11.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.com> wrote in message
    > news:uo7Hb32VDHA.1052@TK2MSFTNGP09.phx.gbl...
    > > Right click on the project in "Solution Explorer". Select Properties.
    > Then
    > > go to the "Imports" tab, and add system.data.sqlclient.
    > >
    > > "Mark Fox" <info@solelsoftware.com> wrote in message
    > > news:0d3901c3576c$05a7bfb0$a401280a@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.Collections;
    > > > using System.ComponentModel;
    > > > using System.Data;
    > > > using System.Drawing;
    > > > using System.Web;
    > > > using System.Web.SessionState;
    > > > using System.Web.UI;
    > > > using System.Web.UI.WebControls;
    > > > using System.Web.UI.HtmlControls;
    > > >
    > > > is there a way to make it so that VS.NET also
    > > > automatically includes
    > > >
    > > > using System.Data.SqlClient;
    > > >
    > > > ? Thanks!
    > >
    > >
    >
    >

    Mark Heimonen Guest

  5. #4

    Default 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.com> wrote in message
    news:uT7cON3VDHA.1748@TK2MSFTNGP12.phx.gbl...
    > 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:uv3mGI3VDHA.2268@TK2MSFTNGP11.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.com> wrote in message
    > > news:uo7Hb32VDHA.1052@TK2MSFTNGP09.phx.gbl...
    > > > Right click on the project in "Solution Explorer". Select Properties.
    > > Then
    > > > go to the "Imports" tab, and add system.data.sqlclient.
    > > >
    > > > "Mark Fox" <info@solelsoftware.com> wrote in message
    > > > news:0d3901c3576c$05a7bfb0$a401280a@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.Collections;
    > > > > using System.ComponentModel;
    > > > > using System.Data;
    > > > > using System.Drawing;
    > > > > using System.Web;
    > > > > using System.Web.SessionState;
    > > > > using System.Web.UI;
    > > > > using System.Web.UI.WebControls;
    > > > > using System.Web.UI.HtmlControls;
    > > > >
    > > > > is there a way to make it so that VS.NET also
    > > > > automatically includes
    > > > >
    > > > > using System.Data.SqlClient;
    > > > >
    > > > > ? Thanks!
    > > >
    > > >
    > >
    > >
    >
    >

    George Ter-Saakov Guest

  6. #5

    Default 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$LR3VDHA.3376@tk2msftngp13.phx.gbl...
    > Thanks.
    > But I probably misunderstood. I thought it would add automatically using
    > directives to the source.
    >
    > George.
    >
    > "Mark Heimonen" <markh@adiaim.com> wrote in message
    > news:uT7cON3VDHA.1748@TK2MSFTNGP12.phx.gbl...
    > > 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:uv3mGI3VDHA.2268@TK2MSFTNGP11.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.com> wrote in message
    > > > news:uo7Hb32VDHA.1052@TK2MSFTNGP09.phx.gbl...
    > > > > Right click on the project in "Solution Explorer". Select
    Properties.
    > > > Then
    > > > > go to the "Imports" tab, and add system.data.sqlclient.
    > > > >
    > > > > "Mark Fox" <info@solelsoftware.com> wrote in message
    > > > > news:0d3901c3576c$05a7bfb0$a401280a@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.Collections;
    > > > > > using System.ComponentModel;
    > > > > > using System.Data;
    > > > > > using System.Drawing;
    > > > > > using System.Web;
    > > > > > using System.Web.SessionState;
    > > > > > using System.Web.UI;
    > > > > > using System.Web.UI.WebControls;
    > > > > > using System.Web.UI.HtmlControls;
    > > > > >
    > > > > > is there a way to make it so that VS.NET also
    > > > > > automatically includes
    > > > > >
    > > > > > using System.Data.SqlClient;
    > > > > >
    > > > > > ? Thanks!
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Mark Heimonen Guest

  7. #6

    Default 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! - [url]www.microsoft.com/security[/url]
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    !Content-Class: urn:content-classes:message
    !From: "Mark Fox" <info@solelsoftware.com>
    !Sender: "Mark Fox" <info@solelsoftware.com>
    !References: <0d3901c3576c$05a7bfb0$a401280a@phx.gbl> <uo7Hb32VDHA.1052@TK2MSFTNGP09.phx.gbl>
    <uv3mGI3VDHA.2268@TK2MSFTNGP11.phx.gbl> <uT7cON3VDHA.1748@TK2MSFTNGP12.phx.gbl> <5c6101c35779
    $6a914330$a001280a@phx.gbl>
    !Subject: Re: Changing VS.NET defaults
    !Date: Thu, 31 Jul 2003 08:45:17 -0700
    !Lines: 91
    !Message-ID: <01a501c3577a$bd7abcb0$a101280a@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.public.dotnet.framework.aspnet
    !Path: cpmsftngxa06.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:163815
    !NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !Nevermind. I found the template I have to change. It's
    !in
    !
    !C:\Program Files\Microsoft Visual
    !Studio .NET\VC#\DesignerTemplates\1033
    !
    !You could change any of the default templates there.
    !
    !The VB templates are in
    !
    !C:\Program Files\Microsoft Visual Studio .NET\Vb7
    !\DesignerTemplates
    !
    !
    !>-----Original Message-----
    !>Mark,
    !>
    !> I added System.Data.SqlClient 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:uv3mGI3VDHA.2268@TK2MSFTNGP11.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.com> wrote in message
    !>>> news:uo7Hb32VDHA.1052@TK2MSFTNGP09.phx.gbl...
    !>>> > Right click on the project in "Solution Explorer".
    !>Select Properties.
    !>>> Then
    !>>> > go to the "Imports" tab, and add
    !>system.data.sqlclient.
    !>>> >
    !>>> > "Mark Fox" <info@solelsoftware.com> wrote in message
    !>>> > news:0d3901c3576c$05a7bfb0$a401280a@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.Collections;
    !>>> > > using System.ComponentModel;
    !>>> > > using System.Data;
    !>>> > > using System.Drawing;
    !>>> > > using System.Web;
    !>>> > > using System.Web.SessionState;
    !>>> > > using System.Web.UI;
    !>>> > > using System.Web.UI.WebControls;
    !>>> > > using System.Web.UI.HtmlControls;
    !>>> > >
    !>>> > > is there a way to make it so that VS.NET also
    !>>> > > automatically includes
    !>>> > >
    !>>> > > using System.Data.SqlClient;
    !>>> > >
    !>>> > > ? Thanks!
    !>>> >
    !>>> >
    !>>>
    !>>>
    !>>
    !>>
    !>>.
    !>>
    !>.
    !>
    !


    Yan-Hong Huang[MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139