我目前正在使用执行SQL任务来提取动态信息,以便为每个数据库构建我的连接字符串。从那里我将它们传递到Foreach循环。此时我正在使用表达式构建我的连接字符串:
“Data Source =”+ @ [User :: DatabaseServer] +“\\”+ @ [User :: Instance] +“; User ID =”+ @ [User :: UserName] +“; Password =” + @ [User :: Password] +“; Initial Catalog = Defaul; Provider = SQLNCLI10.1;”
当我的连接字符串使用双反斜杠构建时,我的问题如下。
Data Source = DatabaseServer \\ InstanceName; User ID = UserName; Password = Password; Initial Catalog = Default; Provider = SQLNCLI10.1;
有谁知道如何防止双反斜杠发生?我试过使用转义字符但我没有成功。
答案 0 :(得分:0)
i found a work around of the issue :
what I have done is :
I have taken the first parameter for connction string like : "anystaring
and the second parameter for the db is : newdb"
so now check the screenshot I have given the URL(not able to upload the image sorry):