OleDbConnection Con_Admin = new OleDbConnection(); BindingSource bs = new BindingSource(); OleDbDataAdapter da; DataTable dt; public void Show_Admin_GridView() { try { Con_Admin.Open(); } catch { } dataGridView1.DataSource = null; da = new OleDbDataAdapter(frm2_HomePage.frm8_Admin_GridQry, Con_Admin); OleDbCommandBuilder MyCommandBuilder = null; MyCommandBuilder = new OleDbCommandBuilder(da); dt = new DataTable(); da.Fill(dt); bs.DataSource = dt; dataGridView1.DataSource = bs; dataGridView1.Enabled = true; dataGridView1.AutoResizeColumns(); try { Con_Admin.Close(); } catch { } } public void SaveChanges() { try { da.Update(dt); } catch (Exception exceptionObj) { MessageBox.Show(exceptionObj.Message.ToString()); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)