connectionstring and user Instance

Discussion in 'ASP .Net' started by Tony Johansson, Jan 3, 2010.

  1. Hello!

    Assume I use the ASP.NET web site administration tool that is generating
    ASPNETDB.MDF database file and the web.config.

    My first question if the web.config doesn't have any connection string from
    where is the connection string fetched ?
    I guess that the connection string is fetched from machine.config is that
    correct ?

    My second question is about user instance=True. Sometimes is the connection
    string generated with the user instance=True
    at which occasions can I remove this user instance=True. I have read about
    this User Instance but I can't fully understand what they mean.

    //Tony
     
    Tony Johansson, Jan 3, 2010
    #1
    1. Advertising

  2. Tony Johansson

    Patrice Guest

    Hi,

    > My first question if the web.config doesn't have any connection string
    > from where is the connection string fetched ?
    > I guess that the connection string is fetched from machine.config is that
    > correct ?


    Correct, this is hierarchical. The documentation always mention the default
    values (http://msdn.microsoft.com/en-us/library/bf7sd233.aspx shows the
    LocalSqlServer connection string).

    > My second question is about user instance=True. Sometimes is the
    > connection string generated with the user instance=True
    > at which occasions can I remove this user instance=True. I have read about
    > this User Instance but I can't fully understand what they mean.


    Usually databases are to be configured once for all in SQL Server and then
    are just usable (basically the SQL Server engine registers the path for the
    data files and then all those databases are just ready to be used whenever
    the SQL Server service starts).

    A user instance allows to dynamically open an arbitrary SQL Server data
    file without prior configuration and even if the user has no adminitrative
    rights. It is used by both VS (allowing to easily create and use a database
    even if the user has no admin rights) or desktop application. IMO for an
    ASP.NET application this is useless (but you'll have to configure SQL Server
    Express to "attach" once for all this DB file to the engine).

    Not sure if the paper that was unclear is the one I mentioned
    (http://msdn.microsoft.com/en-us/library/ms254504(VS.80).aspx). Else you can
    also try http://msdn.microsoft.com/en-us/library/bb264564(SQL.90).aspx that
    is straigth from the SQL Server documentation.

    --
    Patrice
     
    Patrice, Jan 3, 2010
    #2
    1. Advertising

  3. Tony Johansson

    Abdul Sami Guest

    Your firt question: Yes it takes connectionstring from machine.config. If you
    define it in web.config then it will override the default values of
    machine.config.

    --
    Abdul Sami


    "Tony Johansson" wrote:

    > Hello!
    >
    > Assume I use the ASP.NET web site administration tool that is generating
    > ASPNETDB.MDF database file and the web.config.
    >
    > My first question if the web.config doesn't have any connection string from
    > where is the connection string fetched ?
    > I guess that the connection string is fetched from machine.config is that
    > correct ?
    >
    > My second question is about user instance=True. Sometimes is the connection
    > string generated with the user instance=True
    > at which occasions can I remove this user instance=True. I have read about
    > this User Instance but I can't fully understand what they mean.
    >
    > //Tony
    >
    >
    > .
    >
     
    Abdul Sami, Jan 4, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Prothman [MVP]

    Re: [ASP.NET] MS SQL Connectionstring

    Carl Prothman [MVP], Jul 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    6,534
    Carl Prothman [MVP]
    Jul 11, 2003
  2. Arjen
    Replies:
    0
    Views:
    471
    Arjen
    Aug 23, 2005
  3. =?Utf-8?B?REo=?=

    Connectionstring User and Password Not Being Used

    =?Utf-8?B?REo=?=, Jun 21, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    493
    =?Utf-8?B?REo=?=
    Jun 22, 2006
  4. =?Utf-8?B?R3VydQ==?=

    Sending username and pagename to ConnectionString

    =?Utf-8?B?R3VydQ==?=, Jun 22, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    294
    bruce barker \(sqlwork.com\)
    Jun 22, 2006
  5. den 2005
    Replies:
    4
    Views:
    235
    den 2005
    Jul 26, 2006
Loading...

Share This Page