Advertisement
thommy1972de2

ListView Ausgabe

Jul 6th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1.         public void ma_laden()
  2.         {
  3.  
  4.             try
  5.             {
  6.                 connection.Open();
  7.                 OleDbCommand command = new OleDbCommand();
  8.                 command.Connection = connection;
  9.                 command.CommandText = "SELECT * FROM Mitarbeiter";
  10.                 OleDbDataReader reader = command.ExecuteReader();
  11.  
  12.                
  13.  
  14.                 while (reader.Read())
  15.                 {
  16.                     ListViewItem item = new ListViewItem(reader["id"].ToString());
  17.                     item.SubItems.Add(reader["nachname"].ToString());
  18.                     item.SubItems.Add(reader["vorname"].ToString());
  19.                     lv_mitarbeiter.Items.Add(item);
  20.                    
  21.                 }
  22.             }
  23.             catch (Exception ex)
  24.             {
  25.                 MessageBox.Show("Error  " + ex);
  26.             }
  27.         }
  28.  
  29.         private void lv_mitarbeiter_MouseClick(object sender, MouseEventArgs e)
  30.         {
  31.          
  32. ????
  33.  
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement