Adding a new Row - Data Sets - ADO.NET
Posted on 2006-04-02
As a part of an academic project i'm developing an electricity meter reader. It consists of a pocket pc application as well as the desktop application. VB.Net is the programming language. We've been told that there's no need to create a DB for the desktop application and instead use DataSets and pass the data to XML. The same approach will be taken for the Pocket pc application. When we plugin the pocket pc application to the Desktop pc, these XML files will be automatically synchronised using Microsoft Active Sysnc. We do not have to write any code for the synchronisation. Now in the Desktop application i have only 1 form. The data that needs to be stored are (Customer first name, Customer last name, Tel No, Address Line1, Address Line 2, Post Code, Day-time Reading, Night-time Reading). On this form i should be able to Add new Customers. The only data that will be passed to the XML file in the Pocket pc application is Day-time Reading and the Night-time Reading.
When adding new Customers obviously i have to append that data to the XML file, isn't it?
So my understanding is, I Read the already synchronised XML file on the Desktop application to the DataSet using ReadXml method, then populate the Dataset and append the new row to the DataSet which will then be passed to the XML file using WriteXml method. Am i correct?
When doing this do i need to define a structure to the DataSet or when i Read the XML file and populate it to the DataSet does it automatically define the DataSet structure and populate it?