Advertisement
SrJefers_Loading

jeferson

Jun 7th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. String^ conecto = L"datasource=localhost;port=3306;username=root;password=jeferson";
  2. MySqlConnection^ conDataBase = gcnew MySqlConnection(conecto);
  3. MySqlCommand^ cmdDataBase = gcnew MySqlCommand("select * from proyecto_bd.admin;", conDataBase);
  4. MySqlDataReader^ Lectura;
  5. try{
  6. MySqlDataAdapter ^ sda = gcnew MySqlDataAdapter();
  7. sda->SelectCommand = cmdDataBase;
  8. DataTable^ dbdataset = gcnew DataTable();
  9. sda->Fill(dbdataset);
  10. BindingSource^ bsource = gcnew BindingSource();
  11.  
  12. bsource->DataSource = dbdataset;
  13. dataGridView1->DataSource = bsource;
  14. sda->Update(dbdataset);
  15.  
  16. }
  17. catch (Exception^ex){
  18.  
  19. MessageBox::Show(ex->Message);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement