invamsWaimi
New Member
I have built a custom validator,I have a sql query like this:\[code\]protected void custom_serverValidate(object sender, ServerValidateEventArgs e) { connect(); string strSQL = "select EmailAddress from Accounts_Users where EmailAddress=" + REmailTextBox.Text; SqlCommand cmd = new SqlCommand(strSQL, objConnection); if (e.Value.ToString() == cmd.ExecuteScalar().ToString()) { e.IsValid = false; } else e.IsValid = true; disConnect(); }\[/code\]when I execute my code in the browser and an email address and submit it , I get the error mentioned in the title. how to fix it ?