Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void metroTile1_Click(object sender, EventArgs e)
- {
- try
- {
- OleDbConnection connection = new OleDbConnection();
- connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\user\Desktop\Student\Database.accdb;
- Persist Security Info=False;";
- connection.Open();
- OleDbCommand com1 = new OleDbCommand();
- com1.Connection = connection;
- string qu = "update [Student] set [std-name]='" + Name_txt.Text + "' ,[Phone]='" + Phone_txt.Text + "' ,[Address]='" + Address_txt.Text + "' ,[Email]='" + Email_txt.Text + "' ,[Grander]='" + Grander_txt.Text + "' ,[Birthday]='" + Birthday_txt.Text + "' ,where [ID]='" + Load_txt.Text + "'";
- com1.CommandText = qu;
- com1.ExecuteNonQuery();
- MessageBox.Show("Update Completed", "Completed", MessageBoxButtons.OK, MessageBoxIcon.None);
- connection.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString(), "error");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement