Advertisement
Guest User

Untitled

a guest
Feb 25th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using System;
  2. using System.Data;
  3. using MySql.Data.MySqlClient;
  4.  
  5. namespace MySQLSample {
  6. class MainClass {
  7. public static void Main (string[] args) {
  8. using (var con = new MySqlConnection ("server=localhost;user=root;password=xxxxxxxx;database=mysql;")) {
  9. con.Open ();
  10. using (var command = new MySqlCommand("show variables", con)) {
  11. using (var reader = command.ExecuteReader ()) {
  12. while (reader.Read ()) {
  13. Console.WriteLine ("-----------------------");
  14. Console.WriteLine ("| {0} | {1} |", reader ["variable_name"], reader ["value"]);
  15. }
  16. }
  17. }
  18. Console.WriteLine("-----------------------");
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement