I get this error when I click Submit on my registration form -
System.Data.SqlClient.SqlException: 'Incorrect syntax near the keyword 'Table'.'
Below is my code:
if(IsPostBack)
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
conn.Open();
string checkuser = "select count(*) from Table where UserName='" + TextBoxUN.Text +"'";
SqlCommand com = new SqlCommand(checkuser, conn);
int count = Convert.ToInt32(com.ExecuteScalar());
{
Response.Write("User already Exists");
}
conn.Close();