Click to See Complete Forum and Search --> : Directory/Connection String Help


hume.tony
03-05-2009, 01:40 PM
I've got a connection string in my web.config file that goes something like:

<connectionStrings>
<add name="T050 New EngineConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Documents and Settings\User\My Documents\Visual Studio 2005\WebSites\Website\App_Data\Database.mdf';Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient" />
</connectionStrings>

But I need to make it so that the database connects no matter what drive or folder the website is in. So basically I need to condence it to 'App_Data\Database.mdf' but I tried that and it didn't work. Am I missing something or what?