在webbrowser中显示关于无法识别的转义序列的运行时服务器错误。
错误说明:
>'/ image11'应用程序中的服务器错误。编译错误说明: 在编译所需资源期间发生错误 服务这个请求。请查看以下特定错误 详细说明并适当修改源代码。编译器错误消息:CS1009:无法识别的转义序列
来源错误:
Line 21: public void getcon()
Line 22: {
Line 23: con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\MUNDADAN\Documents\..mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
Line 24: con.Open();
Line 25: }
Source File: d:\MY .Net(RuleZZ)\image11\App_Code\Class1.cs Line: 23
Show Detailed Compiler Output:
Show Complete Compilation Source:
答案 0 :(得分:1)
con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\MUNDADAN\Documents\..mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
这是错误的 试试这个
con.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\MUNDADAN\Documents\..mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
或
con.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\MUNDADAN\\Documents\\..mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";