var table = new DataTable(); OleDbConnection coldb = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + bankaddrss); coldb.Open(); OleDbCommand com = new OleDbCommand(); com.Connection = coldb; com.CommandText = " UPDATE Test_Add SET[FirstName]=@param1,[LastName]=@param2,[Salary]=@param3 WHERE ID="+dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); com.Parameters.AddWithValue(@"param1", maskedTextBox_FirstName.Text); com.Parameters.AddWithValue(@"param2", maskedTextBoxLastName.Text); com.Parameters.AddWithValue(@"param3", maskedTextBox_Salary.Text); com.Parameters.AddWithValue(@"param4",DateTime.Now); com.CommandType = CommandType.Text; var DA = new OleDbDataAdapter(com); DA.Fill(table); dataGridView1.DataSource = table; coldb.Close();
dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)