Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String^ conecto = L"datasource=localhost;port=3306;username=root;password=jeferson";
- MySqlConnection^ conDataBase = gcnew MySqlConnection(conecto);
- MySqlCommand^ cmdDataBase = gcnew MySqlCommand("select * from proyecto_bd.admin;", conDataBase);
- MySqlDataReader^ Lectura;
- try{
- MySqlDataAdapter ^ sda = gcnew MySqlDataAdapter();
- sda->SelectCommand = cmdDataBase;
- DataTable^ dbdataset = gcnew DataTable();
- sda->Fill(dbdataset);
- BindingSource^ bsource = gcnew BindingSource();
- bsource->DataSource = dbdataset;
- dataGridView1->DataSource = bsource;
- sda->Update(dbdataset);
- }
- catch (Exception^ex){
- MessageBox::Show(ex->Message);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement