提问人:Ritik Shrivastav 提问时间:11/1/2023 最后编辑:CharliefaceRitik Shrivastav 更新时间:11/1/2023 访问量:35
Connection 属性尚未在 ASP.NET 中初始化
Connection property has not been initialized in ASP.NET
问:
dbconnection con = new dbconnection();
string usermail = txtboxmail.Text;
string userpass = txtpassword.Text;
string query = "SELECT * FROM Admin_Login where Email='" + usermail + "', Password='" + userpass + "'";
SqlCommand cmd = new SqlCommand(query);
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read())
{
Response.Write("<script>alert('Login Success')</script>");
}
else
{
Response.Write("<script>alert('Something Went Wrong')</script>");
}
我正在尝试创建一个登录页面,当我运行该页面时,它显示标题中提到的错误。
答: 暂无答案
评论
using
ExecuteScalar()
SELECT 1
OR
,