Hello Experts!
I have two form, form1 and form2. I'm trying to call an event from form1 into form2, but keep on getting an error. I've made that event from private to public in form1, but still it does not function. Also when the event is recognised by the comppiler, it should open an tabPage, which is also not functionning. Hers the script, can anyone see where i've gone wrong. thanks.
private void button1_Click(object sender, System.EventArgs e)
{
SqlConnection da = new SqlConnection(
@"Data Source= xxxxxxxx;"+
"Initial Catalog = Test;" +
"Network Library=DBMSSOCN;"+
"user id =xxx;"+
"Password=xxxxxx");
da.Open();
SqlCommand thisCommand = da.CreateCommand();
String sQuery = "SELECT Name, LicenseID FROM License WHERE Name = '"+ Form1.textBox1.Text +"'AND LicenseID = '"+ Form1.textBox2.Text +"' ";
SqlCommand cmd = new SqlCommand(sQuery, da);
SqlDataReader dr = cmd.ExecuteReader();
if(dr.Read())
{
tabPage3.Show();
}
}
I have two form, form1 and form2. I'm trying to call an event from form1 into form2, but keep on getting an error. I've made that event from private to public in form1, but still it does not function. Also when the event is recognised by the comppiler, it should open an tabPage, which is also not functionning. Hers the script, can anyone see where i've gone wrong. thanks.
private void button1_Click(object sender, System.EventArgs e)
{
SqlConnection da = new SqlConnection(
@"Data Source= xxxxxxxx;"+
"Initial Catalog = Test;" +
"Network Library=DBMSSOCN;"+
"user id =xxx;"+
"Password=xxxxxx");
da.Open();
SqlCommand thisCommand = da.CreateCommand();
String sQuery = "SELECT Name, LicenseID FROM License WHERE Name = '"+ Form1.textBox1.Text +"'AND LicenseID = '"+ Form1.textBox2.Text +"' ";
SqlCommand cmd = new SqlCommand(sQuery, da);
SqlDataReader dr = cmd.ExecuteReader();
if(dr.Read())
{
tabPage3.Show();
}
}