if (Convert.ToInt32(oledbcom.ExecuteScalar()) > 0) 提示FROM 子句语法错误。
protectedboolisName(stringuser_name){OleDbConnectionoledbconn=newOleDbConnection("Pro...
protected bool isName(string user_name)
{
OleDbConnection oledbconn = new OleDbConnection("Provider= Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/liuyan.mdb"));
oledbconn.Open();
OleDbCommand oledbcom = new OleDbCommand("select count(*) from user where user_name='" + txtName.Text + "'", oledbconn);
if (Convert.ToInt32(oledbcom.ExecuteScalar()) > 0)
{
return true;
}
else
{
return false;
}
oledbconn.Close();
} 展开
{
OleDbConnection oledbconn = new OleDbConnection("Provider= Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/App_Data/liuyan.mdb"));
oledbconn.Open();
OleDbCommand oledbcom = new OleDbCommand("select count(*) from user where user_name='" + txtName.Text + "'", oledbconn);
if (Convert.ToInt32(oledbcom.ExecuteScalar()) > 0)
{
return true;
}
else
{
return false;
}
oledbconn.Close();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询