无法识别的转义序列
private static String MyConnectionString="server=(local)\SQLEXPRESS database=GestBook";
protected void Page_Load(object sender, EventArgs e)
{
try{
SqlConnection myConnection=new SqlConnection();
myConnection.ConnectionString=MyConnectionString;
myConnection.Open();
Response.Write("<br><b>数据库连接状态为:"+myConnection.State.ToString());
Response.Write(myConnection.Database.ToString());
myConnection.Close();
}
catch(Exception ex)
{
Response.Write("数据链接失败"+ex.Message);
}
}
就显示出:无法识别的转义序列
server=(local)\SQLEXPRESS出错