Philippe Leybaert
Philippe Leybaert

Reputation: 171734

ADO.NET connection string and password with "=" in it

How do I build a connection string which includes a passsword having a "=" in it? (I'm connecting to MySql 5.1)

For example, let's say the password is "Ge5f8z=6", what would the connection string look like?

I tried:

Server=DBSERV;Database=mydb;UID=myuser;PWD="Ge5f8z=6";

and

Server=DBSERV;Database=mydb;UID=myuser;PWD=Ge5f8z=6;"

Both don't work.

Upvotes: 4

Views: 1522

Answers (2)

CResults
CResults

Reputation: 5105

Precede it with another =, so Ge5f8z==6 should work

Source http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(VS.71).aspx

Upvotes: 2

Nix
Nix

Reputation: 58522

Use two == signs.

So it would be

  Server=DBSERV;Database=mydb;UID=myuser;PWD=Ge5f8z==6;"

Upvotes: 5

Related Questions