Visit Map

Monday, October 11, 2004

Using XML Serialization

I have started my code for a bigger module. Which contains Lots a new stuff. I have lots of new things to explore. I need to learn a lot. Till now i have a learnt a Very little bit. It was said "Known is a drop and Unknown is a ocean." I have used XML Serialization for loading data into a dataset. This goes likes this I will get all the data in a array list The array list contains objects of a class (which is a model class which contains only properties) I will loop through the array list and get the xml strings. All the xml strings will be loaded to into string builder. After that i will load the xml to a dataset. But this approach has some issues. The xml is loaded into different tables i.e. all the elements in the xml file are loading into different tables. That’s why i looked for some other work around for this. I will make the model class as a data table. All the properties will become columns in the datatable. After getting the datatable i will attach this datatable to dataset. The dataset will be loaded into a data grid. I need to see how this goes.
I have known that the above approach is very useful.
But we can load the arraylist directly to the data grid.
The arraylist contains a bunch of Model class which contains property values.
We have to assign the data source of the data grid to the array list and we need to assign the specific property names to the data grid.