为什么关闭不了数据库呢?
string conStr=System.Configuration.ConfigurationSettings.AppSettings["Access"];
OleDbConnection con=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+System.Web.HttpContext.Current.Server.MapPath(conStr));
con.Open();
OleDbCommand cmd=new OleDbCommand("select count(*) from admin where userName='"+userName+"' and userPassWord='"+userPassWord+"'",con);
int count=(int)cmd.ExecuteScalar();
if(count>0)
{
return "YES";
}
else
{
return "NO";
}
con.Close();
这里我的代码,后面一行con.Close();提示检测到无法访问的代码,请问怎么回事呢