mahmud_uk

mahmud_uk

  • NA
  • 48
  • 0

Open another tabPage

Aug 9 2004 9:07 AM
Hi Guys, I have two forms, form1 has textBox 1&2. From form2 i'm trying to access the event fields of these textBoxes. Also on form2 i have several tabPages. When a button on form2 tabPage2 is clicked it should retrive the values of textBoxe 1&2 and open tabPage3. I cant reference the textBoxes from form1 also dont know how to open tabPag3. Heres the code, hope someone could help: SqlConnection da = new SqlConnection( @"Data Source= xxx;"+ "Initial Catalog = drmTest;" + "Network Library=DBMSSOCN;"+ "user id =sa;"+ "Password=xxx"); 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(); }

Answers (1)