Guest User

Untitled

a guest
Aug 24th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
  2. {
  3. SqlConnection con = new SqlConnection(polaczenie_baza);
  4. dataGridView2.DataSource = null;
  5. dataGridView2.Update();
  6. dataGridView2.Refresh();
  7. SqlCommand command1 = new SqlCommand("select id, data_przychodu, rodzaj, kwota from przychody", con);
  8. con.Open();
  9. command1.CommandType = CommandType.Text;
  10. SqlDataAdapter sqlDataAdap = new SqlDataAdapter(command1);
  11. DataTable bookings = new DataTable();
  12. sqlDataAdap.Fill(bookings);
  13. dataGridView2.DataSource = bookings;
  14. con.Close();
  15. }
Add Comment
Please, Sign In to add comment