DataSet.WriteXml question

  • Thread starter Thread starter Mounil Kadakia
  • Start date Start date
M

Mounil Kadakia

hi all,
I wanted to know if there's any way I can influence how the output
of the xml would be using WriteXml.

for eg,
if my dataset has a table called tblMyTable, then in the output XML i want
<MyTable> instead of <tblMyTable>

TIA,
Mounil.
 
Hi Rakesh,
Thanks for your reply. I wasnt very clear on my question.
so i'll give it another try. I have a dataset (myDataSet) which contains
various tables.i've named the tables with the prefix tbl. eg, tblEntity.

so i get the following output with myDataSet.WriteXml()

<tblEntity>
<EntityID>100</EntityID>
<Entity_Name>Entity1</Entity_Name>
<Entity_Address>10 Downing St </Entity_Address>
<Entity_Phone>+44123456789</Entity_Phone>
<Entity_Fax>+44345566777</Entity_Fax>
<tblEntity>

what i wanted to find out is if there's any way i can influence the xml so
that i can get <Entity> instead of <tblEntity>.

I had a look at the ColumnMapping property; but that only applies to the
table's columns.

TIA,
Mounil.
 
Hello Mounil,

have a look here on msdn:

"Using Annotations with a Typed DataSet"
http://msdn.microsoft.com/library/d...tml/cpconusingannotationswithtypeddataset.asp

I did not read the whole article, but it sounds related to your question.

Here an excerpt:

"Annotations enable you to modify the names of the elements in your
typed DataSet without modifying the underlying schema.
....
Using annotations, you can customize the names of objects in your typed
DataSet with more meaningful names, making code more readable and your
typed DataSet easier for clients to use, while leaving underlying schema
intact.
"

Happy Programming
Gordian
 
Back
Top