|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Saving a Database to DiskOk, I've got a program I am working on that is supposed to save all
changes to the dataset to the actual database, but this doesn't seem to be working. I used the DataAdapter.Update(DataSet) method, but that doesn't save the changes to my actual database. How can I go about updating the actual database to save changes? Please help, Jager Jager,
A dataadapter update does only save datarows from which the rowstate is not "not changed". However how a rowstate is set, depends very much how your program is build, so therefore you have to tell more. Cor Well I can use the commands to add information to my database and it
saves the changes to the database itself, but when I delete rows by using RemoveAt for the CurrentSelectedRow , the database won't save the changes. I have also tried the delete method and I don't beleve that worked. What I need it to do is save the changes to the database in anyway possible without manually saving the changes ( I can't expect the person using this to save on his own.) If I can get this all to work, I'll be in good shape, I think. Jager,
You need to use Delete if you are trying to mark the row for deletion from the database. Kerry Moorman Show quoteHide quote "Jager" wrote: > Well I can use the commands to add information to my database and it > saves the changes to the database itself, but when I delete rows by > using RemoveAt for the CurrentSelectedRow , the database won't save the > changes. I have also tried the delete method and I don't beleve that > worked. What I need it to do is save the changes to the database in > anyway possible without manually saving the changes ( I can't expect > the person using this to save on his own.) If I can get this all to > work, I'll be in good shape, I think. > > Jager,
In addition to Kerry, RemoveAt or all other Removes in this situations, remove a datarow complete from a datatable with all its aspects. A delete, set the row to be removed after and update or with an acceptchanges. (This alone for those row for which this is important. newly added rows will be with delete as well direct removed from a datatable) I hope this helps, Cor
Newbie Question: How To Open A File Non-Exclusively?
Command line argument in NET Windows Form Application Help Release Memory Prog execution in IDE works, fails when running exe unexpected split functionality - index out of bounds Integer to color Multiple result sets from Data Reader VS2005-VB Viewing 'Main' for MDIParent ActiveDS or System.DirectoryServices |
|||||||||||||||||||||||