Welcome to Webhost4life Forum Sign in | Join | Faq

MSSQL

Started by Methael at 04-16-2008 2:50 PM. Topic has 3 replies.

Print Search
Sort Posts:    
   04-16-2008, 2:50 PM
Methael is not online. Last active: 5/8/2008 1:35:17 PM Methael

Top 500 Posts
Joined on 04-16-2008
Posts 2
connectionString
Reply Quote
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

   Report 
   05-27-2008, 12:50 AM
deanman is not online. Last active: 10/11/2008 2:19:42 AM deanman

Top 10 Posts
Joined on 04-11-2007
Posts 187
Re: connectionString
Reply Quote
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
   Report 
   05-27-2008, 1:11 AM
admin is not online. Last active: 10/11/2008 9:15:39 AM admin

Top 10 Posts
Joined on 08-10-2005
Posts 244
Re: connectionString
Reply Quote
Get rid of ;Integrated Security=True in your connection string and that should fix it.

   Report 
   05-27-2008, 1:29 AM
deanman is not online. Last active: 10/11/2008 2:19:42 AM deanman

Top 10 Posts
Joined on 04-11-2007
Posts 187
Re: connectionString
Reply Quote
<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
   Report 
Webhost4life Fo... » Database Relate... » MSSQL » Re: connectionString

Powered by Community Server, by Telligent Systems