all groups > sql server connect > january 2005 >
You're in the

sql server connect

group:

Passing "@" to SQL connection string



Passing "@" to SQL connection string Sandy Beach
1/18/2005 9:37:03 AM
sql server connect: Hi,

I'm using c# to connect to a sql database.

My dev work is fine and it connects; when deployed to the live environment,
it needs to have special chacters (@ and !) in it. The ! goes through fine,
but @ is removed. If I hard code the @, it's fine, but my setting is held in
a variable.

Does anybody know how I can pass the @ sign through to a ConnectionString?
I've tried escaping it with a \, but it won't compile (\@ is not a valid
escape sequence).

Thanks,

Re: Passing "@" to SQL connection string William (Bill) Vaughn
1/18/2005 10:08:13 AM
What SQL database? Why do you need a "@"? Is it part of a UserName or
Password?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

[quoted text, click to view]

Re: Passing "@" to SQL connection string Sandy Beach
1/19/2005 1:17:02 AM
Thanks for the response.

I'm trying to connect to a SQL 2000 db and the "@" starts the password. The
DB administrator set it up for the user account I'm allowed to log in as.

Cheers,

Sandy

[quoted text, click to view]
Re: Passing "@" to SQL connection string Sandy Beach
1/19/2005 2:23:01 AM
Thanks for helping, but I've managed to track down the problem and it had
nothing to do with the "@" in the password.

I'm encrypting/decrpyting the password, and the decrypt has a list of valid
characters. Guess what? "@" wasn't one of them!

So, again, thanks for you help and time.

Cheers,

Grahame

[quoted text, click to view]
AddThis Social Bookmark Button