Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

VS.Net 2005 - Default ConnectionString ?

Back to Forum: Tech Off
  • User profile image
    phreaks

    I was debugging some code in one of my NUnit tests and I made a startling (to me) discovery.

    Even though I have not setup the ConnectionString's in the Settings or Config files, there is one present, although I am unable to locate it.

    Why is this here and how do I get rid of it?

    Note: This is a Winform project, so no idea why the aspnetdb.mdf file is auto included.

    String val = System.Configuration.ConfigurationManager.ConnectionStrings[0].ConnectionString;

    Console.WriteLine(val)

    ====================================
    ? val

    "data source=.\\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"

  • User profile image
    Sven Groot

    This appears to be the connection string for the default ASP.NET 2.0 application services providers.

    It's defined in machine.config, so every application will have it.

  • User profile image
    phreaks

    Sven Groot wrote:
    This appears to be the connection string for the default ASP.NET 2.0 application services providers.

    It's defined in machine.config, so every application will have it.


    Ah, that makes sense.

    Thnx

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.