Character special in ADO ConnectionString.

J

Jefferson Valim

Hi,

we have a function that defines the password of the user access the data
base. This function was written initially in Delphi and the access to the
data base is ADO. In this environment the access is made without problems.
In C# with ADO.net when attributing the password is returned the following
error: Format of the initialization string you donate not conform you
specification starting at index 89.

Code example:
string sConn = "Data Source=10.28.0.6;Initial Catalog=dsMatriz;Persist
Security Info=False;User ID=teste;Password={0}";
byte[] b = new byte[] { 9, 13, 10, 28};
sConn = string.Format(sConn, UTF8Encoding.UTF8.GetString(b));
SqlConnection conn = new SqlConnection();
conn.ConnectionString = sConn; // Exception. Format of the initialization
string does not conform to specification starting at index 89.
conn.Open();

Any idea about this error?

Thanks,

Jefferson Valim
JBS Group
Brazil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top