Connection string with an instance in umbracoDbDSN problem
I can't connect to my database because the connection string with an instance in umbracoDbDSN converts the slash that denotes the instance to a double slash. So for example:
<addkey="umbracoDbDSN"value="MyServer\sqlexpress; database=umbraco4; user id=sa; password=XXXX" />
when I debug the code, I see it uses the connection string
MyServer\\sqlexpress; database=umbraco4; user id=sa; password=XXXX
If I place a \\ instaed, it doubles that too and the result is \\\\ (4 slashes)
In C# backslash is a escape character. I.e, a tab is \t.
As backslash is an escape character, if you want to insert a backslash in an string you have to type two backslashes together.
The debugger uses exactly the same syntax, so when you see two backslashes in the debugger there is only one. And when you see four, there are in fact two backslashes.
The real problem is that your connection string is missing the "server=" part from "server=MyServer\sqlexpress". Add the missing "server=" and it should work fine.
Connection string with an instance in umbracoDbDSN problem
I can't connect to my database because the connection string with an instance in umbracoDbDSN converts the slash that denotes the instance to a double slash. So for example:
<add key="umbracoDbDSN" value="MyServer\sqlexpress; database=umbraco4; user id=sa; password=XXXX" />
when I debug the code, I see it uses the connection string
MyServer\\sqlexpress; database=umbraco4; user id=sa; password=XXXX
If I place a \\ instaed, it doubles that too and the result is \\\\ (4 slashes)
Can someone help me please :) ?
Thanks
In C# backslash is a escape character. I.e, a tab is \t.
As backslash is an escape character, if you want to insert a backslash in an string you have to type two backslashes together.
The debugger uses exactly the same syntax, so when you see two backslashes in the debugger there is only one. And when you see four, there are in fact two backslashes.
The real problem is that your connection string is missing the "server=" part from "server=MyServer\sqlexpress". Add the missing "server=" and it should work fine.
is working on a reply...