Monday, March 12, 2012

MS SQL Express - Connection Strings for Depolyment

From my Web.Config

<connectionStrings>
<add name="CustomerConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="D:\-- Work Documents --\Workez\Web\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings
It's obvious to me that the next in orange would cause my db application not to work when i roll it out onto the net.

Am i correct to say this? I recalled i needed something like "Server.mappath("path-name")"

anyone know what i need to do?

Xarain wrote:

From my Web.Config

<connectionStrings>
<add name="CustomerConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="D:\-- Work Documents --\Workez\Web\App_Data\ASPNETDB.MDF";Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings
It's obvious to me that the next in orange would cause my db application not to work when i roll it out onto the net.

Am i correct to say this? I recalled i needed something like "Server.mappath("path-name")"

anyone know what i need to do?

Hi,

Actually when you publish the website, you have to setup the database in the SQL server provided by the hosting service and you cannot use the db in the app_data folder at all.

No comments:

Post a Comment