Guest User

Untitled

a guest
May 12th, 2018
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1.  
  2. private void buttonSearchHire_Click(object sender, EventArgs e)
  3. {
  4. connection = new SqlConnection(cs);
  5. connection.Open();
  6. SqlCommand cmd1 = connection.CreateCommand();
  7.  
  8.  
  9.  
  10. cmd1.CommandText = "select WypozyczenieID, KsiazkaID, w.CzytelnikID, DataWypozyczenia, DataOddania, Imie + ' ' + Nazwisko As Czytelnik FROM Wypozyczenie w"
  11. + "join Czytelnik c on c.CzytelnikId = w.CzytelnikId"
  12. + "where Imie like '"+ textBoxSearchHire.Text + "%'";
  13.  
  14.  
  15. SqlDataAdapter adapt = new SqlDataAdapter(cmd1);
  16. DataSet ds1 = new DataSet();
  17. adapt.Fill(ds1);
  18. dataGridHire.DataSource = ds1.Tables[0].DefaultView;
  19. connection.Close();
  20. }
  21. }
Add Comment
Please, Sign In to add comment