Connection String error
- Hello,
I deployed a web site to my hosting server and restored a database.
However the web site cannot connect to the database.
I also tried with Database Manager in IIS and the same happens.
I am using the following connection string:
<connectionStrings>
<add
name="BonsAlunos.Domain.Properties.Settings.BonsAlunosConnectionString"
connectionString="Data Source=IP;Initial
Catalog=BonsAlunos;User ID=BonsAlunos;Password=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
I get the error:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 25 - Connection string is not valid)
The user is defined in the sql server and I followed this article to
solve the remote connections problem:
http://www.linglom.com/2009/03/28/enable-remote-connection-on-sql-ser...
Does anyone knows what might be wrong?
I am not sure where to go from here.
Thanks,
Miguel
Answers
Hi Miguel,See the below links (MSDN BLOGS) for all the problems and steps need to be taken when a client is connnecting to sql
http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx
Thanks, Leks- Proposed As Answer byChunSong Feng -MSFTMSFT, ModeratorTuesday, November 10, 2009 5:20 AM
- Marked As Answer byChunSong Feng -MSFTMSFT, ModeratorMonday, November 16, 2009 9:42 AM
<connectionStrings>
<add
name="BonsAlunos.Domain.Properties.Settings.BonsAlunosConnectionString"
connectionString="Data Source=IP;Initial
Catalog=BonsAlunos;User ID=BonsAlunos;Password=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
Use serverName\instanceName as Data Source to connect to a specific SQL Server instance.
Are you using SQL Server 2008 Express? Don't miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server Express installation resides.
See more information about connection strings here: http://www.connectionstrings.com/
Hope this helps.
ChunSong Feng
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
- Proposed As Answer byChunSong Feng -MSFTMSFT, ModeratorTuesday, November 10, 2009 5:20 AM
- Marked As Answer byChunSong Feng -MSFTMSFT, ModeratorMonday, November 16, 2009 9:42 AM
All Replies
Hi Miguel,See the below links (MSDN BLOGS) for all the problems and steps need to be taken when a client is connnecting to sql
http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx
http://blogs.msdn.com/sqlexpress/archive/2004/07/23/192044.aspx
Thanks, Leks- Proposed As Answer byChunSong Feng -MSFTMSFT, ModeratorTuesday, November 10, 2009 5:20 AM
- Marked As Answer byChunSong Feng -MSFTMSFT, ModeratorMonday, November 16, 2009 9:42 AM
<connectionStrings>
<add
name="BonsAlunos.Domain.Properties.Settings.BonsAlunosConnectionString"
connectionString="Data Source=IP;Initial
Catalog=BonsAlunos;User ID=BonsAlunos;Password=password"
providerName="System.Data.SqlClient" />
</connectionStrings>
Use serverName\instanceName as Data Source to connect to a specific SQL Server instance.
Are you using SQL Server 2008 Express? Don't miss the server name syntax Servername\SQLEXPRESS where you substitute Servername with the name of the computer where the SQL Server Express installation resides.
See more information about connection strings here: http://www.connectionstrings.com/
Hope this helps.
ChunSong Feng
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
- Proposed As Answer byChunSong Feng -MSFTMSFT, ModeratorTuesday, November 10, 2009 5:20 AM
- Marked As Answer byChunSong Feng -MSFTMSFT, ModeratorMonday, November 16, 2009 9:42 AM


