Guest User

Untitled

a guest
Jan 16th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. private void button5_Click(object sender, EventArgs e)
  2. {
  3. SqlConnection conn = new SqlConnection("Data Source=MAZI-PC\PROJECTACC;Initial Catalog=programDB;Integrated Security=True");
  4. SqlCommand cmd = new SqlCommand("select label_sh from label_text where label_form='2' and label_form_labelID='1'", conn);
  5. conn.Open();
  6. label1.Text = cmd.ExecuteReader().ToString();
  7. conn.Close();
  8.  
  9. SqlConnection conn1 = new SqlConnection("Data Source=MAZI-PC\PROJECTACC;Initial Catalog=programDB;Integrated Security=True");
  10. SqlCommand cmd1 = new SqlCommand("select label_sh from label_text where label_form='2' and label_form_labelID='2'", conn1);
  11. conn1.Open();
  12. label2.Text = cmd1.ExecuteReader().ToString();
  13. conn1.Close();
  14.  
  15. SqlConnection conn2 = new SqlConnection("Data Source=MAZI-PC\PROJECTACC;Initial Catalog=programDB;Integrated Security=True");
  16. SqlCommand cmd2 = new SqlCommand("select label_sh from label_text where label_form='2' and label_form_labelID='3'", conn2);
  17. conn2.Open();
  18. label3.Text = cmd2.ExecuteReader().ToString();
  19. conn2.Close();
  20. }
  21.  
  22. label3.Text = (string) cmd2.ExecuteScalar();
Add Comment
Please, Sign In to add comment