Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. SqlCommand command = conn.CreateCommand();
  2. command.CommandText = "select Test from PrescTest pt, Prescription p where pt.idPresc=p.idPresc";
  3. conn.Open();
  4.  
  5. SqlDataReader dr2 = command.ExecuteReader();
  6. try
  7. {
  8. if (dr2.HasRows)
  9. {
  10. string Tests ="";
  11. while (dr2.Read())
  12. {
  13. // get the results of column "Test"
  14. Tests += dr2["Test"].ToString() + System.Environment.NewLine;
  15. }
  16. TextBox15.Text = Tests.Trim();
  17. conn.Close();
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement