开发者

PowerShell script not accepting $ (dollar) sign

开发者 https://www.devze.com 2022-12-09 02:03 出处:网络
I am trying to open an SQL data connection using a PowerShell script and my password contains a $ sign:

I am trying to open an SQL data connection using a PowerShell script and my password contains a $ sign:

$cn = new-object system.data.SqlClient.SqlConnection("Data Source=DBNAME;Initial Catalog=Catagory;User ID=开发者_如何学CUser;Password=pass$word;")

When I try to open a connection it says:

Login failed


Escape it by using backtick (`) as an escape character for the dollar sign ($).

Also, try to enclose the statement in single-quotes instead of the double-quotes you are using now.

0

精彩评论

暂无评论...
验证码 换一张
取 消