---
title: "The same connection succeed and fails in different .net solutions"  
description: "The same connection succeed and fails in different .net solutions"  
author: "Anonymous User"  
published: 2013-06-19  
updated: 2013-06-19  
canonical: https://www.mindstick.com/forum/1215/the-same-connection-succeed-and-fails-in-different-dot-net-solutions  
category: "ado.net"  
tags: ["ado.net"]  
reading_time: 1 minute  

---

# The same connection succeed and fails in different .net solutions

Hi [Expert](https://www.mindstick.com/articles/13120/an-expert-financial-advice-will-improve-your-finances),\
\
I have two .net solutions. They both have this code:\
\
var connectionString = "Server = ServerName; [Database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax) = DatabaseName; Trusted_Connection=True;"\
var [connection](https://www.mindstick.com/articles/13012/what-makes-ethernet-connection-better-than-wifi) = new [SqlConnection](https://www.mindstick.com/forum/1209/sqlconnection-sqlcommand-sqldatareader-idisposable)(connectionString);\
connection.Open();\
connection.Close();\
\
And they both use complitely the same connectionString. And they [connect](https://www.mindstick.com/articles/12810/how-to-connect-tablet-to-external-monitor-or-flat-screen-tv-using-computer-adapters) to [MSSQL Server](https://www.mindstick.com/forum/159376/foreign-key-works-if-we-communicate-with-two-databases-in-mssql-server);\
\
And in the first solution connection.Open() succeeded and in the second one it failed. [Error message](https://www.mindstick.com/forum/23174/error-message-the-page-you-are-requesting-cannot-be-served-because-of-the-extension-configuration) : Named Pipes [Provider](https://answers.mindstick.com/qa/92701/who-is-the-best-telecom-solution-provider), error: 40 - Could not open a connection to [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-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?

## Replies

### Reply by Sumit Kesarwani

Hi Ankit,\
Open Sql Server Configuration Manager and make sure that the Named Pipes option is enabled for your Sql server instance.


---

Original Source: https://www.mindstick.com/forum/1215/the-same-connection-succeed-and-fails-in-different-dot-net-solutions

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
