C# – Help with DataAdapter – DB doesn’t update

ado.netc++dataset

I have a data adapter. When I check the function at runtime I see the changes, but nothing happens in the database. How do I debug this? What went wrong?

OleDbDataAdapter adapter = new OleDbDataAdapter();
string queryString = "SELECT * FROM tasks";
OleDbConnection connection = new OleDbConnection(cn.ConnectionString);
adapter.SelectCommand = new OleDbCommand(queryString, connection);
OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);

connection.Open();

adapter.Fill(ds.Tables["Tasks"]);                      

adapter.Update(ds);

return ds;

Best Solution

Nothing is happening in the database because you're running a SELECT query. What are you expecting to happen?