I need a help. I got this:
SqlConnection sc = new SqlConnection("Data Source=(LocalDB)\\v11.0; Integrated Security=SSPI" + "AttachDbFilename=E:\\user\\program\\Database1.mdf");
I tried to set Integrated Security to True or even False. None of them works. Help!
Clearly, you are missing a semi-colon after SSPI, so the argument is being read as SSPIAttachDbFilename=E:\\user\\program\\Database1.mdf
which is not a valid value for Integrated Security.
This should work.
var sc = new SqlConnection("Data Source=(LocalDB)\\v11.0; Integrated Security=SSPI;"
+ "AttachDbFilename=E:\\user\\program\\Database1.mdf")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With