Click to See Complete Forum and Search --> : How to change the MappingType of a column when using the DataSetDesigner?


Holly_vi
August 29th, 2008, 07:24 AM
I am trying to use the DataSet Designer to create a DataSet for my application.
In the Designer.cs file that was created by the designer, I see that the MappingType of all columns of the DataTables is MappingType.Element.
How do I change the MappingType to be of type MappingType.Attribute?
It is important to me, because later I want to save the DataSet into an Xml file, and I want the columns to be represented as attributes.
Also, is it possible to define a column not to appear in the Xml file?

toraj58
September 1st, 2008, 08:11 AM
the second part of your question is possible; you can use such this SQL query:

select col1, col2 from testtable

and if you have for example col3 it will be ignored then you write to XML only select cols.

But for the first part of your question i should say it is weird to me; for me XmlNode is applicable for columns and attributes for extra information about the node!

Touraj Ebrahimi [toraj_e] [at] [yahoo] [dot] [com]