problem writing xml from dataset

  • Thread starter Thread starter Andreas Schulz
  • Start date Start date
A

Andreas Schulz

Hi,

I have a DataSet filled with values from the access database using the
InTheHand wrapper. Now I want to extract the table records to an xml
file or stream using the DataSet.WriteXml method. My problem now is that
I need the xml formatted in a special way, e.g. I need some record
values as attributes within a xml tag. Is that somehow possible? If yes
how?

Hope I expressed clearly enough to understand my problem.

Andreas
 
You can set the ColumnMapping property of each column within the table to
determine its mapping type. Possible values include attribute, element etc.
E.g.
mydataset.Tables["tablename"].Columns["fieldname"].ColumnMapping =
MappingType.Attribute
will place values in the "fieldname" column as attributes in your generated
xml.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top