Can anyone help me understand why this connection string is not working. I have the following piece of code
string connString = "user id=sa;password=;initial catalog=dbName;data source=Test;Connect Timeout=30";
SqlConnection connect = new SqlConnection(connString);
try
{
connect.Open();
.....}
catch
{
...
}
It gives me the error "SQL server does not exist or access denied." The datasource is correct and tests out correctly in the ODBC administrator. It does not matter what database name I put in there. Another interresting thing, If I change the connection string and eliminate the data source completely it give me the error
"Login failed for user "sa" Not associated with a trusted SQL server connection" I have used the ODBC connection and database in my C++ application and they work just fine. Any ideas why C# is causing me such a headache? Thanks for any help.
string connString = "user id=sa;password=;initial catalog=dbName;data source=Test;Connect Timeout=30";
SqlConnection connect = new SqlConnection(connString);
try
{
connect.Open();
.....}
catch
{
...
}
It gives me the error "SQL server does not exist or access denied." The datasource is correct and tests out correctly in the ODBC administrator. It does not matter what database name I put in there. Another interresting thing, If I change the connection string and eliminate the data source completely it give me the error
"Login failed for user "sa" Not associated with a trusted SQL server connection" I have used the ODBC connection and database in my C++ application and they work just fine. Any ideas why C# is causing me such a headache? Thanks for any help.