G
Guest
Using Vs2005 sqlServer 2005
When i try to connect i get this 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)
Connection string:
<connectionStrings>
<add name="pubsConnectionString1" connectionString="Data Source=.;Initial
Catalog=pubs;User=mk;pw=x"
providerName="System.Data.SqlClient" />
</connectionStrings>
Calling code :
try
{
using (SqlConnection cn = new
SqlConnection(WebConfigurationManager.ConnectionStrings[0].ConnectionString))
{
cn.Open();
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
When i try to connect i get this 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)
Connection string:
<connectionStrings>
<add name="pubsConnectionString1" connectionString="Data Source=.;Initial
Catalog=pubs;User=mk;pw=x"
providerName="System.Data.SqlClient" />
</connectionStrings>
Calling code :
try
{
using (SqlConnection cn = new
SqlConnection(WebConfigurationManager.ConnectionStrings[0].ConnectionString))
{
cn.Open();
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}