Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void buttonSearchHire_Click(object sender, EventArgs e)
- {
- connection = new SqlConnection(cs);
- connection.Open();
- SqlCommand cmd1 = connection.CreateCommand();
- cmd1.CommandText = "select WypozyczenieID, KsiazkaID, w.CzytelnikID, DataWypozyczenia, DataOddania, Imie + ' ' + Nazwisko As Czytelnik FROM Wypozyczenie w"
- + "join Czytelnik c on c.CzytelnikId = w.CzytelnikId"
- + "where Imie like '"+ textBoxSearchHire.Text + "%'";
- SqlDataAdapter adapt = new SqlDataAdapter(cmd1);
- DataSet ds1 = new DataSet();
- adapt.Fill(ds1);
- dataGridHire.DataSource = ds1.Tables[0].DefaultView;
- connection.Close();
- }
- }
Add Comment
Please, Sign In to add comment