connectionString

MSSQL

connectionString


Methael 04-16-2008, 2:50 PM
I am new to asp.net and dont know well how to correctly configure and establish a connection to database.<br><br>

I recive currently the error "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
<br><br>
as connection string in my web.config i have :

<br><br>

add name="LocalSqlServer" connectionString="Data Source=sql392.mysite4now.com;Initial Catalog=MethaelsPlayground;Integrated Security=True;uid=xxx;pwd=xxx" providerName="System.Data.SqlClient" <br><br>

would be great is someone could help out here

Re: connectionString


deanman 05-27-2008, 12:50 AM
The problem is that you have used the connection string for the SQL Express version!


Try the ones below.

connectionStrings

add name="SiteSqlServer" connectionString="Server=sql392.mysite4now.com;Database='The name of your data base';uid='DB User ID';pwd='DB password';" providerName="System.Data.SqlClient"


appSettings

add key="SiteSqlServer" value="Server=sql392.mysite4now.com;Database='The name of your data base';uid='DB User ID';pwd=''DB password'';"
I <3 WebHost4Life.com

Re: connectionString


admin 05-27-2008, 1:11 AM
Get rid of ;Integrated Security=True in your connection string and that should fix it.

Re: connectionString


deanman 05-27-2008, 1:29 AM
<BLOCKQUOTE><table width="85%"><tr><td class="txt4"><img src="/Themes/default/images/icon-quote.gif">&nbsp;<strong>admin wrote:</strong></td></tr><tr><td class="quoteTable"><table width="100%"><tr><td width="100%" valign="top" class="txt4">

Get rid of ;Integrated Security=True in your connection string and that should fix it.<br>


</td></tr></table></td></tr></table></BLOCKQUOTE>


Well, 'LocalSqlServer' has to be renamed to 'SiteSqlServer' as well. ;)
I <3 WebHost4Life.com
webhost4life.com

Powered by Community Server, by Telligent Systems