|
Posted by raylopez99 on 04/02/07 15:41
On Apr 1, 3:41 pm, Erland Sommarskog <esq...@sommarskog.se> wrote:
> raylopez99 (raylope...@yahoo.com) writes:
> > Yes, but for some reason \SQLEXPRESS doesn't compile in VS2005 "S not
> > recognized" error
>
> If you program in C++ (and I assume C#) you need to double the \, as
> \ has a special meaning in string literals in C++.
>
> --
Yes it worked! You are correct Erland. The double slash did work,
and the program compiled and worked perfectly. (For some reason the
forward slash, which usually also works for paths in lieu of the
double slash, did not compile however).
For the record here is what worked for the connection string:
connection->ConnectionString = "Persist Security Info = False;
Integrated Security=SSPI;" "Data Source=(local)\\SQLEXPRESS; Initial
Catalog=MyDATABASEnameHERE_DB;";
//note the double slash: \\
No need to supply a password in the connection string (using Windows
Authentication).
Thanks again! Now I can pickup this book on SQL again, which I set
aside.
RL
[Back to original message]
|