System.Data.SqlClient.SqlConnection foo = new System.Data.SqlClient.SqlConnection(); foo.ConnectionString = "Data Source=myServer;Integrated Security=SSPI;"; // exception thrown on this line
If I declare a new SqlConnection
object in my .net code and then set the ConnectionString
field to a syntactically invalid connection string, an exception is thrown.
I have checked several times that if the connection string is semantically incorrect (eg. invalid server name, wrong password), no exception is thrown.
What logic is the SqlConnection
object using to validate the connection string at this point? I've tried to no avail to answer this question using RedGate Reflector.