SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["RegistrationConnectionString"].ConnectionString); conn.Open(); string checkUser = " select count(*) form Userdata where Username='" + TextBoxUN.Text + "' "; SqlCommand cmd = new SqlCommand(checkUser,conn);
System.Data.SqlClient.SqlException was unhandled by user code HResult=-2146232060 Message=Incorrect syntax near 'Userdata'
int temp= Convert.ToInt32(cmd.ExecuteScalar().ToString()); // *** if (temp==1) { Response.Write("User Already Exists"); } conn.Close();
string checkUser = " select count(*) form Userdata where Username='" + TextBoxUN.Text + "' ";
string checkUser = " select count(*) FROM Userdata where Username='" + TextBoxUN.Text + "' ";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)