Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Button_Clicked(object sender, EventArgs e)
- {
- string ConnectionString = @"xxxx;User Id=xxxx;Password=xxxx;Database=xxxx";
- MySqlConnection myConnection = new MySqlConnection(ConnectionString);
- try
- {
- if (myConnection.State == System.Data.ConnectionState.Closed) {
- myConnection.Open();
- databaseText.Text = "Database: ON";
- string pass = RandomString(10);
- MySqlCommand cmd = new MySqlCommand("UPDATE passwords SET pass = @password", myConnection);
- cmd.Parameters.AddWithValue("@password", pass);
- cmd.ExecuteNonQuery();
- myConnection.Close();
- }
- }
- catch (Exception ex)
- {
- databaseText.Text = ex.ToString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement