Thursday, March 29, 2012

Change local connection string on remote server

Hello,

I have searched every post and tried every connection string there but can't figure out how to connect to my database on my remote server. I am using Visual Developer 2005 Express Edition in C# and uploading it to a Windows server running asp.net 2.0. The domain has not resolved yet.

I am so new to this and have followed many tutorials step by step but none of them address this issue. They just show how to upload it to the server.

Do I need to use the SQL server provided by my host or can the database stay in the App_Data folder?

My local connection string works locally:

<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\add_newSQL.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />

When I uploaded to my server I changed \SQLEXPRESS to (local) as advised in the forum.

<add name="ConnectionString" connectionString="Data Source=(local);AttachDbFilename=|DataDirectory|\add_newSQL.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

When I debug a page I get the <customErrors mode="Off"/>
error message even thought I have already set it in my remote web.config file which may be causing problems itself:

<configuration>

<appSettings/>

<connectionStrings>

<add name="ConnectionString" connectionString="Data Source=(local);AttachDbFilename=|DataDirectory|\add_newSQL.mdf;Integrated Security=True;User Instance=True"

providerName="System.Data.SqlClient" />

</connectionStrings>

<system.web>

<customErrors mode="Off" />

<compilation debug="false" />

<authentication mode="Windows" />

</system.web>

</configuration>

Thanks for any help you can offer. I wish I could find someone to hire to do this part for me or teach me how over the phone. Any suggestions?

You are running SQL Express on your development system (your local computer). Are you running SQL Express on the web server?

Thanks,
Bryan

|||Having this same, problem!!!!!|||So the same question to you, as the question wasn′t answered by the original poster, are you running SQL Server Express on the WebServer ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de

No comments:

Post a Comment