DataTable, not writing to database
From: Mike (Mike_at_discussions.microsoft.com)
Date: 03/24/05
- Next message: Ste: "PockePC 2003 How to enable power supply for external device?"
- Previous message: Daniel Moth: "Re: Sending SMS"
- Next in thread: Sergey Bogdanov: "Re: DataTable, not writing to database"
- Reply: Sergey Bogdanov: "Re: DataTable, not writing to database"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Mar 2005 02:11:06 -0800
I am having problems getting records to save to a DataTable and was hoping
maybe someone out there could help. I am using a DataTable that is bound to
a data entry form. Basically, here is how it flows....
1.) DataTable has several records in it.
2.) User pushes a button to signal that they are done with the current
record (and therefore dont want to see it anymore) and a flag is inserted in
the record to indicate this.
3.) I want to commit all the current records in the DataTable to the
database and requery the database so that it brings up a fresh datatable
(minus the record the user just said they were done with).
This is the code I am using
'Trying to commit the changes to the database
DataAdapter.Update(DataTable)
DataTable.AcceptChanges()
'Clear the current DataTable
DataTable.Clear
'Requery Database
cmd.CommandText = MySqlStatement
DataAdapter= New AdoceDataAdapter(cmd)
DataAdapter.Fill(DataTable)
But when I do this, I dont get any records to return because the never got
wrote to the database? Any suggestions?
Thanks!
Mike
- Next message: Ste: "PockePC 2003 How to enable power supply for external device?"
- Previous message: Daniel Moth: "Re: Sending SMS"
- Next in thread: Sergey Bogdanov: "Re: DataTable, not writing to database"
- Reply: Sergey Bogdanov: "Re: DataTable, not writing to database"
- Messages sorted by: [ date ] [ thread ]