Must declare the scalar variable “@Email”

后端 未结 4 1113
名媛妹妹
名媛妹妹 2020-12-22 00:14

I am trying to pass values from a database table to a couple of labels where the email column matches the email entered.I have passed the email entered from login page to th

4条回答
  •  生来不讨喜
    2020-12-22 00:28

    Try like this instead

      SqlCommand cmd = new SqlCommand("Select * from tblRegister where Email = @Email", con);
      cmd.Parameters.AddWithValue("@Email", lblEmail.Text);
      SqlDataReader rdr = cmd.ExecuteReader();
      //...
    

提交回复
热议问题