txtBox2.Enabled = false;
//made by francisco juliao
Convert.ToInt32(txtBox1.Text);
int Ticket = Convert.ToInt32(txtBox1.Text);
SqlConnection mySC = new SqlConnection();
SqlCommand com = new SqlCommand();
mySC.ConnectionString = ("Data Source=localhost;Initial Catalog=RCA;Integrated Security=True");
mySC.Open();
com.Connection = mySC;
com.CommandText = (@"SELECT Ticketid * FROM RCA)
VALUES ('" + txtBox1.Text + "','" + output+ "');");
mySC.Close();
if (Ticket = //SQL ticketID check here.
txtBox2.Enabled = true;
MessageBox.Show("Valid ID! Input email now.");
label1.Text = "Enter your email now.";
}
else
{
MessageBox.Show("Incorrect!");
}
So I want my C# app to check if the ticketID(txtBox1.Text)
that was typed by the user is in the SQL server. I have no idea how I would go about doing this. If the input is correct the label changes and the textbox2
gets enabled. If the email is not found in the sql database, a messagebox is shown with the text "incorrect!". Any help would be appreciated!