how generate xml file in c# dynamically

Posted by Suneel161 under C# on 6/20/2011 | Points: 10 | Views : 22089 | Status : [Member] | Replies : 3
Hi,

how generate xml file.
like
<?xml version="1.0" encoding="UTF-8" ?>
- <book_ticket>
- <seat_details>
- <seat_detail>
<seat_number>14</seat_number>
<title>Mr</title>
<name>Ravi</name>
<age>28</age>
<sex>M</sex>
<is_primary>true</is_primary>
</seat_detail>
- <seat_detail>
<seat_number>15</seat_number>
<title>Mrs</title>
<name>Kavi</name>
<age>24</age>
<sex>F</sex>
<is_primary>false</is_primary>
</seat_detail>
</seat_details>
- <contact_detail>
<email>ravi@gmail.com</email>
<mobile_number>9742282521</mobile_number>
<emergency_name>Kavi</emergency_name>
</contact_detail>
</book_ticket>
how to send xml in post method.




Responses

Posted by: Lakn2 on: 6/20/2011 [Member] Starter | Points: 25

Up
0
Down
try this

http://geekswithblogs.net/thibbard/articles/C-sharp-code-to-dynamically-generate-CoT-XML.aspx


Thanks&Regards
LakshmiNarayana Nalluri.

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 6/20/2011 [Member] Starter | Points: 25

Up
0
Down
You can use linq to generate the xml, take a look at approach 3
http://www.dotnetfunda.com/forums/thread4932-convert-string-to-xml-and-pass-it-to-a-stored-proc.aspx

Then you can send this xml string.
Thanks,
Debata

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 6/21/2011 [Member] [MVP] Bronze | Points: 25

Login to post response