C#提示 identity附近有语法错误,反复检查后不知道哪错了~在线等!!!
stringcode=TextBox1.Text.Trim();stringcode1=TextBox2.Text.Trim();SqlConnectionconn=ne...
string code = TextBox1.Text.Trim();
string code1 = TextBox2.Text.Trim();
SqlConnection conn = new SqlConnection("server=.\\sqlexpress;database=manufacture system;uid=sa;pwd=sa");
string sqllogin = "select * from identity where name='" + code + "' and password='" + code1 + "' ";
SqlCommand comlogin = new SqlCommand(sqllogin, conn);
try
{
conn.Open();
if (comlogin.ExecuteNonQuery() > 0)
{
Response.Redirect("Default.aspx");
}
}
catch (Exception ex)
{
Response.Write("<script>alert('" + ex.Message + "!')</script>");
}
finally
{
conn.Close();
} 展开
string code1 = TextBox2.Text.Trim();
SqlConnection conn = new SqlConnection("server=.\\sqlexpress;database=manufacture system;uid=sa;pwd=sa");
string sqllogin = "select * from identity where name='" + code + "' and password='" + code1 + "' ";
SqlCommand comlogin = new SqlCommand(sqllogin, conn);
try
{
conn.Open();
if (comlogin.ExecuteNonQuery() > 0)
{
Response.Redirect("Default.aspx");
}
}
catch (Exception ex)
{
Response.Write("<script>alert('" + ex.Message + "!')</script>");
}
finally
{
conn.Close();
} 展开
若以下回答无法解决问题,邀请你更新回答
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询