Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. string MyConnection2 = "datasource=???;port=3306;username=xxx;password=xxxx";
  2. //Display query
  3. string Query = "select * from contableCAF.coa_dc;";
  4. MySqlConnection MyConn2 = new MySqlConnection(MyConnection2);
  5. MySqlCommand MyCommand2 = new MySqlCommand(Query, MyConn2);
  6. // MyConn2.Open();
  7. //For offline connection we weill use MySqlDataAdapter class.
  8. MySqlDataAdapter MyAdapter = new MySqlDataAdapter();
  9. MyAdapter.SelectCommand = MyCommand2;
  10. DataTable dTable = new DataTable();
  11. MyAdapter.Fill(dTable);
  12. dataGridView1.DataSource = dTable;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement