Friday, February 24, 2012

Error 26: When connecting to Local Server with SQL Server 2005 Standard Edition

Hi,

I've been trying to fix this error for two days! and I really need the advice of the experts please!

Computer XP Professional Service Pack2, SQL Server 2005 and Visual Studio 2005 (both Standard Edition)

ConnectionString:

<

connectionStrings>

<add name="MyConnectionDB" connectionString="Data Source=(MyServer\SqlServer2005);Initial Catalog=MyDB;User ID=sa;Password=PasswordforSA"providerName="System.Data.SqlClient" />

</connectionStrings>

C# code

string

myConnectionString = ConfigurationManager.ConnectionStrings["MyConnectionDB"].ConnectionString;

SqlConnection myConnection = new SqlConnection(myConnectionString);

myConnection.Open();

Here I get 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)"}

What I checked so far:

ServerName and Instance NameOK!Database, Username and passwordOK!SQL Server 2005 Surface Are Configuration - Remote connections using both TCP/IP and Pipe NamesOK!SQL Configuration Manager - Protocolos Enabled (TCP/IP, Pipes, shared)OK!SQL Server Browse running and activeOK!

Am I missing something? I never had this problem with SQL Server 2000 and Visual Studio 2003.

Thanks in advance for any help or suggestion you can give me.

Sasa

Nevermind, I reinstalled again .NET 2.0 and it works. I can't believe that I expend two days thinking it was a configuration setting

No comments:

Post a Comment