David Smith

David Smith

  • NA
  • 2k
  • 0

appconfig /connectionString

Mar 17 2010 9:45 AM

I have a appconfig that i use , is there anyway to set up the path to where the exe will automatic detect the database im talking to or allowing the customer to talk to the mdf. So that way they wont have to keep opening up the appconfig and changing the path.


right now I have the appconfig as

 <connectionStrings>
    <add name="Data.Properties.Settings.DatabaseConnectionString"

      connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=&quot;C:\Documents and Settings\z1083774\Desktop\Data
     
      \Database.mdf&quot;;Integrated Security=True;Connect Timeout=30;User Instance=True"
     
      providerName="System.Data.SqlClient" />

I know I can put it in the root directory c:\  ,but i know there is another way to do it.


Answers (13)