forum

Home / DeveloperSection / Forums / The same connection succeed and fails in different .net solutions

The same connection succeed and fails in different .net solutions

Anonymous User205819-Jun-2013
Hi Expert,

I have two .net solutions. They both have this code:

var connectionString = "Server = ServerName; Database = DatabaseName; Trusted_Connection=True;"
var connection = new SqlConnection(connectionString);
connection.Open();
connection.Close();

And they both use complitely the same connectionString. And they connect to MSSQL Server;

And in the first solution connection.Open() succeeded and in the second one it failed. Error message : Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

And every time I create new solution it fails. So this connection only works in one specific solution. And also, my teammates tested this and didn't have such issues.

Can you help with hints why it can be so?

Updated on 19-Jun-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By