Advertisement
Guest User

Untitled

a guest
Jan 13th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using UnityEngine;
  2. using MySql.Data.MySqlClient;
  3.  
  4. public class test : MonoBehaviour {
  5.     private string connectionString = "Server=mysqlx.gear.host;Database=testxx;User=xxxx;Password=xxxx;";
  6.    
  7.     // Use this for initialization
  8.     void Start () {
  9.         using (MySqlConnection conn = new MySqlConnection())
  10.         {
  11.             conn.ConnectionString = connectionString;
  12.             conn.Open();
  13.             MySqlCommand command = conn.CreateCommand();
  14.             command.CommandText = "INSERT INTO iets VALUES ('Hallo!')";
  15.             print("hoi!");
  16.             command.ExecuteNonQuery();
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement