-2
我的連接字符串SQL服務器:錯誤的連接字符串
Con = new SqlConnection("Data Source=JMAL-PC\SQLEXPRESS ;Initial Catalog=Goda;Integrated Security=True");
,但我得到一個錯誤:
Unrecognized escape sequence!
我的連接字符串SQL服務器:錯誤的連接字符串
Con = new SqlConnection("Data Source=JMAL-PC\SQLEXPRESS ;Initial Catalog=Goda;Integrated Security=True");
,但我得到一個錯誤:
Unrecognized escape sequence!
試試這個
這是由於Escape Sequences在C#
轉義序列通常用於指定諸如回車和標籤頁移動之類的操作小型打印機和打印機。
因此,如果你想表示反斜槓,那麼你應該使用\\
或者你可以使用@"....neglect...escape...sequence"
Con = new SqlConnection("Data Source=JMAL-PC\\SQLEXPRESS ;Initial Catalog=Goda;Integrated Security=True");
另一種可能性是
Con = new SqlConnection(@"Data Source=JMAL-PC\SQLEXPRESS ;Initial Catalog=Goda;Integrated Security=True");
請添加展示它是如何解決你的代碼的一些解釋問題。這將有助於其他人誰在未來的搜索後找到此頁面 – 2014-09-22 09:15:51
謝謝你Ganesh它的工作 – 2014-09-22 11:06:02
你能解釋這個解決方案請 – 2014-09-22 11:10:00