xpblueScreenOfDeath
Programmer
- Sep 1, 2004
- 87
I'm new to using .net typed dataset. I could not figured out how to commit the changes I made in the typed dataset into the database. For the typed dataset, I created a new dataset through Visual studio and I started to drag and drop the tables from server explorer. I configured it to generate the code for insert, update, delete, select. Am I just completed missed understand the uses of a typed dataset?
The following is a example of trying to insert a record into the telephoneloghdr table. The following code didn't throw any errors, but no records was inserted.
The following is a example of trying to insert a record into the telephoneloghdr table. The following code didn't throw any errors, but no records was inserted.
Code:
TelephoneLog ds = new TelephoneLog();
TelephoneLog.TelephoneLogHdrDataTable teleLogHdr = ds.TelephoneLogHdr;
TelephoneLog.TelephoneLogHdrRow teleLogRow = teleLogHdr.NewTelephoneLogHdrRow();
teleLogRow... = ... assign fields
ds.TelephoneLogHdr.AddTelephoneLogHdrRow(teleLogRow);
ds.TelephoneLogHdr.AcceptChanges();