Guest User

Untitled

a guest
Mar 9th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Security.Cryptography.X509Certificates;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using MySql.Data;
  9. using MySql.Data.MySqlClient;
  10.  
  11. namespace Decoupled_Data
  12. {
  13. class Program
  14. {
  15. static void Main(string[] args)
  16. {
  17. string connStr =
  18. "server=localhost; user=root; database=job_ticket_foil_summary;port=3306;password=ttnstamping";
  19. MySqlConnection conn = new MySqlConnection(connStr);
  20.  
  21. DataSet dsCountry = new DataSet();
  22.  
  23. string sql = "SELECT * FROM jt_foil_summary";
  24. MySqlDataAdapter daCountry = new MySqlDataAdapter(sql, conn);
  25.  
  26. MySqlCommandBuilder cb = new MySqlCommandBuilder(daCountry);
  27.  
  28. daCountry.Fill(dsCountry, "jt_foil_summary");
  29.  
  30. //Table of Data should appear here
  31.  
  32. Console.ReadLine();
  33. }
  34. }
  35. }
Add Comment
Please, Sign In to add comment