【发布时间】:2017-11-19 19:15:07
【问题描述】:
我有这条线用于连接我的连接字符串
SqlConnection conn = new SqlConnection("Data Source=(LocalDB)MSSQLLocalDB;AttachDbFilename=""C: \Users\BDV\Documents\Visual Studio 2015\Projects\Interface_notes\Interface_notes\Database1.mdf"";Integrated Security=True;Connect Timeout=30");
但我收到此错误:
Class System.String
Represents Text as a series of Unicode characters
Syntax Error, ',' expected
我认为问题出在双引号上,但我不知道我能做什么。有人可以帮我弄这个吗?谢谢 无法识别的转义序列
【问题讨论】:
-
You need
SqlConnection(@"Data Source=...(并且你在 C: 之后有一个杂散的空间)
标签: c# sql sql-server visual-studio