Advertisement
Guest User

Untitled

a guest
May 5th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. ublic void SubmitData()
  2.         {
  3.             string connectionString =
  4.                 "Server=localhost;" +
  5.                 "Database=test;" +
  6.                 "User ID=myuserid;" +
  7.                 "Password=mypassword;" +
  8.                 "Pooling=false";
  9.            
  10.             MySqlConnection dbcon = new MySqlConnection(connectionString);
  11.             dbcon.Open();
  12.            
  13.             MySqlCommand dbcmd = dbcon.CreateCommand();
  14.  
  15.             dbcmd.CommandText = "INSERT INTO table VALUES ('qwerty','asdfgh')";
  16.             dbcmd.ExecuteNonQuery();
  17.            
  18.             MySqlDataReader reader = dbcmd.ExecuteReader();
  19.             dbcmd.Dispose();
  20.             dbcon.Close();
  21.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement