public partial class Form1 : Form
{
OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Apps\ServiceManagement\Data\ServiceManagement.MDB");
OleDbCommand com;
OleDbDataAdapter ada;
DataSet ds = new DataSet();
public Form1()
{
InitializeComponent();
conn.Open();
OleDbCommand com = new OleDbCommand("SELECT * FROM Customers", conn);
OleDbDataAdapter ada = new OleDbDataAdapter(com);
ada.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void button1_Click(object sender, EventArgs e)
{
OleDbCommandBuilder com = new OleDbCommandBuilder(ada);
DataSet changes = new DataSet();
changes = ds.GetChanges(DataRowState.Modified); //here i get the error
ada.Update(changes.Tables[0]);
}
This post has been edited by Skydiver: 06 March 2013 - 12:29 PM
Reason for edit:: Put code in code tags. Learn to do this yourself.

New Topic/Question
Reply




MultiQuote




|