EDN Admin
Well-known member
<p align=left>Hi folks
<p align=left>
<p align=left>Perhaps you can help with a problem. The fields etc. here are ficticious, just to help make explaining things simpler.
<p align=left>
<p align=left>I have an object of class "Installation". This class has lots of stuff on it. Eventually it is serialized to an XML file when user clicks Save.
<p align=left>
<p align=left>One of the properties of the "Installation" class it is a dataset called MyDataset. The XSD of the dataset is called "ProductionDataSet". This ProducitonDataSet has 3 fields A,B,C
<p align=left>
<p align=left>When the user clicks "Save" all the "Installation" object properties are updated the the file is serialized.
<p align=left>So Installation.MyDataset needs to read the data user enters on datagridview data.
<p align=left>
<p align=left>The bit I am stuck with is filling Installation.MyDataset with the data on the datagridview. I can do the serializing etc. ok.
<p align=left>
<p align=left>Can someone help please with an example of code of how to update the Installation.MyDataset with what is on the datagridview?
<p align=left>
<p align=left>Thanks.
<p align=left>
<p align=left>
<p align=left>In short Ive got to
<p align=left>1) deserialize a dataset and display on data view-->let user load data
<p align=left>2) serialize dataset and save to file-->let user save data from datagridview
<p align=left>
<p align=left>It is possible that more fields will be added to XSD - if more fields are added, they should be saved too
<p align=left>
<p align=left>Thanks!
View the full article
<p align=left>
<p align=left>Perhaps you can help with a problem. The fields etc. here are ficticious, just to help make explaining things simpler.
<p align=left>
<p align=left>I have an object of class "Installation". This class has lots of stuff on it. Eventually it is serialized to an XML file when user clicks Save.
<p align=left>
<p align=left>One of the properties of the "Installation" class it is a dataset called MyDataset. The XSD of the dataset is called "ProductionDataSet". This ProducitonDataSet has 3 fields A,B,C
<p align=left>
<p align=left>When the user clicks "Save" all the "Installation" object properties are updated the the file is serialized.
<p align=left>So Installation.MyDataset needs to read the data user enters on datagridview data.
<p align=left>
<p align=left>The bit I am stuck with is filling Installation.MyDataset with the data on the datagridview. I can do the serializing etc. ok.
<p align=left>
<p align=left>Can someone help please with an example of code of how to update the Installation.MyDataset with what is on the datagridview?
<p align=left>
<p align=left>Thanks.
<p align=left>
<p align=left>
<p align=left>In short Ive got to
<p align=left>1) deserialize a dataset and display on data view-->let user load data
<p align=left>2) serialize dataset and save to file-->let user save data from datagridview
<p align=left>
<p align=left>It is possible that more fields will be added to XSD - if more fields are added, they should be saved too
<p align=left>
<p align=left>Thanks!
View the full article