Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   A network-related or instance-specific error occurred while establishing a connection (http://www.go4expert.com/forums/network-related-instance-specific-error-t15541/)

suri123 18Dec2008 16:21

A network-related or instance-specific error occurred while establishing a connection
 
Hi All,
I am new to ADO.NET using C#.I have made a connection string which consists only the connection string. I am using SQLExpress 2008. connection is not opened.
I got an error showing "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: 26 - Error Locating Server/Instance Specified)"
Below is the code:
SqlConnection cn=new SqlConnection("Data Source=\"C:\\Documents and Settings\\12345\\My Documents\\Visual Studio 2008\\Projects\\CustomerDataBase\\CustomerDataBase \\CustomerInfo.sdf\"");
cn.Open();
Any help would be appreciated..

Thanks in advance.,
Suresh kumar palleti.


All times are GMT +5.5. The time now is 15:24.