Format of the initialization string does not conform to specification starting at index 5."

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: andy (adheyworth_at_gmail.com)
Date: 12/21/04


Date: 21 Dec 2004 14:38:23 -0800

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()



Relevant Pages

  • Re: backslash-issues
    ... where you can't be sure that you are using the ASCII ... > collating sequence if you interpret CHAR according to the Fortran95 ... The whole point of ACHAR is that it is more portable than CHAR ...
    (comp.lang.fortran)
  • Re: CFile::Read problem ???
    ... As far as the C compiler is concerned, ... you can pretty much always assign a char ... > as ASCII and wchar_t as Unicode. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Blowfish Sign Extension bug still exists
    ... > of the compiliers I have used), it seems, given the set you ... I have used compilers where plain char is unsigned, ... in ASCII they are all positive. ...
    (sci.crypt)
  • Re: ASCII value of a character
    ... >> character. ... In other words I'm looking for the reverse of char(). ... AFAIK ANSI is an extension of ASCII, ...
    (alt.comp.lang.borland-delphi)