EDN Admin
Well-known member
Hi, I am trying to get a connection to a SQL Database running on SQL Server Express 2012. When I connect usingSystem::Security::SecureString^ CStr = gcnew System::Security::SecureString;
CStr->MakeReadOnly();
SqlCredential ^cre = gcnew SqlCredential("hansa",CStr);
SqlConnection ^ conn = gcnew SqlConnection("Data Source=HANSSQLEXPRESS;Initial Catalog=soccer;Integrated Security=False",cre);
conn->Open();
the line "conn->Open();" thros following exception: "A network-related or instance-specific error occurred while establishing a connection to SQL Server". the provider is "Named Pipes Provider", the error code is "40".
It goes on to say that I should check that the instance name is correct, and that the server is configured to accept remote connections. the latter is true ( I have checked this), the former (the instance name) seems to be correct to me. If it is not correct, How do I change it so that this works? Does anyone have any additional info??
Cheers!
C
View the full article
CStr->MakeReadOnly();
SqlCredential ^cre = gcnew SqlCredential("hansa",CStr);
SqlConnection ^ conn = gcnew SqlConnection("Data Source=HANSSQLEXPRESS;Initial Catalog=soccer;Integrated Security=False",cre);
conn->Open();
the line "conn->Open();" thros following exception: "A network-related or instance-specific error occurred while establishing a connection to SQL Server". the provider is "Named Pipes Provider", the error code is "40".
It goes on to say that I should check that the instance name is correct, and that the server is configured to accept remote connections. the latter is true ( I have checked this), the former (the instance name) seems to be correct to me. If it is not correct, How do I change it so that this works? Does anyone have any additional info??
Cheers!
C
View the full article