A
andy
Hi all,
Any help much appreciated - Andy
I am trying to connect to a SQL Server DB using c#, ADO.Net
mySqlConnection = new
SqlConnection(@"user=ddd;password=€jfn¾;server=srv5;Trusted_Connection=no;database=dan");
as you can see there are "special" ASCII chars in the user and password
fields. (ASCII 127 and ASCII 157). The following error results when
trying to connect, where index 5 is the '' char in the user name.
"Format of the initialization string does not conform to specification
starting at index 5."
StackTrace
at System.Data.Common.DBConnectionString.GetKeyValuePair(Char[]
connectionString, Int32 currentPosition, String& key, Char[] valuebuf,
Int32& vallength, Boolean& isempty)\r\n
at System.Data.Common.DBConnectionString.ParseInternal(Char[]
connectionString, UdlSupport checkForUdl, NameValuePair& keychain)\r\n
at System.Data.Common.DBConnectionString..ctor(String
connectionString, UdlSupport checkForUdl)\r\n
at System.Data.SqlClient.SqlConnectionString..ctor(String
connectionString)\r\n
at System.Data.SqlClient.SqlConnectionString.ParseString(String
connectionString)\r\n
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String
value)\r\n
at System.Data.SqlClient.SqlConnection..ctor(String
connectionString)\r\n
at HowTo.Samples.ADONET.sqldtreader.Run()
Any help much appreciated - Andy
I am trying to connect to a SQL Server DB using c#, ADO.Net
mySqlConnection = new
SqlConnection(@"user=ddd;password=€jfn¾;server=srv5;Trusted_Connection=no;database=dan");
as you can see there are "special" ASCII chars in the user and password
fields. (ASCII 127 and ASCII 157). The following error results when
trying to connect, where index 5 is the '' char in the user name.
"Format of the initialization string does not conform to specification
starting at index 5."
StackTrace
at System.Data.Common.DBConnectionString.GetKeyValuePair(Char[]
connectionString, Int32 currentPosition, String& key, Char[] valuebuf,
Int32& vallength, Boolean& isempty)\r\n
at System.Data.Common.DBConnectionString.ParseInternal(Char[]
connectionString, UdlSupport checkForUdl, NameValuePair& keychain)\r\n
at System.Data.Common.DBConnectionString..ctor(String
connectionString, UdlSupport checkForUdl)\r\n
at System.Data.SqlClient.SqlConnectionString..ctor(String
connectionString)\r\n
at System.Data.SqlClient.SqlConnectionString.ParseString(String
connectionString)\r\n
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String
value)\r\n
at System.Data.SqlClient.SqlConnection..ctor(String
connectionString)\r\n
at HowTo.Samples.ADONET.sqldtreader.Run()