PC Review


Reply
Thread Tools Rate Thread

DataSet.WriteXml question

 
 
Mounil Kadakia
Guest
Posts: n/a
 
      19th Jul 2005
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.


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UmFrZXNoIFJhamFu?=
Guest
Posts: n/a
 
      19th Jul 2005
Hi,

The MappingType enumeration can infulence the output.

Check out
http://msdn.microsoft.com/library/en...classtopic.asp

--
HTH,
Rakesh Rajan
MVP, MCSD
http://www.msmvps.com/rakeshrajan/



"Mounil Kadakia" wrote:

> 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.
>
>
>

 
Reply With Quote
 
Mounil Kadakia
Guest
Posts: n/a
 
      20th Jul 2005
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.


"Rakesh Rajan" <rakeshrajan {at} mvps {dot} org> wrote in message
news:09992A0C-0882-4266-BDF7-(E-Mail Removed)...
> Hi,
>
> The MappingType enumeration can infulence the output.
>
> Check out:
>

http://msdn.microsoft.com/library/en...classtopic.asp
>
> --
> HTH,
> Rakesh Rajan
> MVP, MCSD
> http://www.msmvps.com/rakeshrajan/
>
>
>
> "Mounil Kadakia" wrote:
>
> > 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.
> >
> >
> >



 
Reply With Quote
 
Gordian
Guest
Posts: n/a
 
      27th Jul 2005
Hello Mounil,

have a look here on msdn:

"Using Annotations with a Typed DataSet"
http://msdn.microsoft.com/library/de...peddataset.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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSet.WriteXml Rastko Soskic Microsoft ADO .NET 1 20th Sep 2006 11:48 AM
DataSet.WriteXML Question =?Utf-8?B?RGFuaWVs?= Microsoft ADO .NET 2 24th Sep 2005 08:25 PM
dataset WriteXML question =?Utf-8?B?TGVlSA==?= Microsoft ADO .NET 1 6th May 2005 02:12 AM
Question about DataSet.WriteXML method. Ken Varn Microsoft ADO .NET 1 11th Mar 2005 01:06 AM
Filling a Dataset and Dataset.WriteXML method.. Serdar C Microsoft C# .NET 3 31st Dec 2004 08:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 PM.