public static void SelectTable(string TabName, string orderBy) { openConnection(); string query = SELECT * FROM [ + TabName + ] ORDER BY + orderBy; connection = new SqlCeConnection(@Data Source=|DataDirectory|\Db\Applicant.sdf;); connection.Open(); sCommand = new SqlCeCommand(query, connection); sAdapter = new SqlCeDataAdapter(sCommand); sBuilder = new SqlCeCommandBuilder(sAdapter); sDs = new DataSet(); sAdapter.Fill(sDs, TabName); sDs.AcceptChanges(); sD_Table = sDs.Tables[TabName];//sD_Table is my datatable dataGridView.DataSource = sD_Table; //this code displays all selected table in mx grid view } //now when i change something on gridview private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { sAdapter.Update(sD_Table); this.dataGridView.Refresh(); here i can c my table is updated }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)