传奇龙之手镯:.NET的高手们注意了,呵呵,帮我个忙,看看

来源:百度文库 编辑:高考问答 时间:2024/04/29 20:17:59
if (mobile.Text.Trim().Length == 11)
{
string cn = System.Configuration.ConfigurationManager.AppSettings["Connstring"];
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString = cn;
oSQLConn.Open();
str = "select * from CusTomer_guest where mobilno ='" + mobile.Text.Trim() + "'";

SqlCommand comm = new SqlCommand(str, oSQLConn);
Int32 count = (Int32)comm.ExecuteScalar();
oSQLConn.Close();
if (count > 0)
{
Panel1.Visible = true;
Panel2.Visible = false;
db();
}
else
{
Panel2.Visible = true;
Panel1.Visible = false;
}
}
else
{
string message = "查询号码不正确,请核对后重新输入!!";
this.Response.Write("<body onload=" + "javascript:alert('" + message + "');" + ">");
}

帮我看看代码有没有错误,能不能精简点,谢谢大家了.

有没有错误自己跑下就清楚拉