Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Data;
- using MySql.Data.MySqlClient;
- namespace MySQLSample {
- class MainClass {
- public static void Main (string[] args) {
- using (var con = new MySqlConnection ("server=localhost;user=root;password=xxxxxxxx;database=mysql;")) {
- con.Open ();
- using (var command = new MySqlCommand("show variables", con)) {
- using (var reader = command.ExecuteReader ()) {
- while (reader.Read ()) {
- Console.WriteLine ("-----------------------");
- Console.WriteLine ("| {0} | {1} |", reader ["variable_name"], reader ["value"]);
- }
- }
- }
- Console.WriteLine("-----------------------");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement