This is my actual code
How can i elemenate that type of error
string strCon = @System.Configuration.ConfigurationManager.ConnectionStrings["stgdbConnectionString"].ConnectionString;
string strSelect = "SELECT ClientId FROM CLIENT WHERE Email = @Email AND Password = @Password";
SqlConnection con = new SqlConnection(strCon);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = strSelect;
SqlParameter email = new SqlParameter("@Email", SqlDbType.VarChar, 50);
email.Value = txtEmail.Text.Trim().ToString();
cmd.Parameters.Add(email);
SqlParameter password = new SqlParameter("@Password", SqlDbType.VarChar, 50);
password.Value = txtPwd.Text.Trim().ToString();
cmd.Parameters.Add(password);
con.Open();
clientid = cmd.ExecuteScalar().ToString();
con.Close();
if (clientid != null)
{
Session["Emailid"] = txtEmail.Text.ToString().Trim();
Session["ClientId"] = clientid;
Response.Redirect("Logout.aspx");
} else
lblMsg.Text = "Incorrect EmailId or Password";
Crp, if this helps please login to Mark As Answer. | Alert Moderator