In past couple weeks I was working on some data conversion projects which required loading data to DataSet with lots of DataTables and then using Linq I tried to join those tables and generate the results.

Mu problem was I sometimes to look at the DataSet and its DataTables in some database view, I mean like tables of a SQL Server database. I used DataSet.WriteXml to generate an Xml file from my import process so when ever I want to convert again I wouldn’t have to go through import process again.

Continue reading “XMLViewer”

DataTable with a ColumnName same as TableName

If you add a column to a DataTable with ColumnName set as TableName, and then save it as Xml using DataSet.WriteXml and then load it from Xml using DataSet.ReadXml, you’ll be surprised by that .Net automatically removed the column and added two more columns with this naming:

Assume that the TableName is “MyName” so the ColumnName is also “MyName”, after saving and loading you’ll lose “MyName” column and all the data in all rows, but you’ll have two new columns “MyName_Id” and “MyName_Id_0” both with data type set to Int32.

Continue reading “DataTable with a ColumnName same as TableName”