XML generation from Listbox

Posted by Mohanbabu17 under C# on 7/28/2010 | Views : 3344 | Status : [Member] | Replies : 4
Hi Friends,

Is there any direct method to generate xml from List Box

as we have in Grid GetXML method

Mohan


Responses

Posted by: Bangarubabu on: 7/28/2010 [Member] Starter

Up
0
Down
As per as My Knowledge

1)It is better To Construct One Customized Data Table which Will holds all the data from listbox

2)Add That Datatable With DataSet

3)Finally Write DataSet Values Into Xml File by Using WriteXml() method







BangaruBabu Pureti
http://bangarubabupureti.spaces.live.com/

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

Posted by: Mohanbabu17 on: 7/28/2010 [Member] Starter

Up
0
Down
Thanks Man.

But Its to complicate. any other way?

Mohan

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

Posted by: Raja on: 7/28/2010 [Member] Starter

Up
0
Down
I think you need to loop through all the items of the ListBox.

foreach (ListItem item in LstView.Items)
{

{


and use the techniques specified in this article http://www.dotnetfunda.com/articles/article160.aspx to generate the xml.

Hope this will work.

Regards,
Raja, USA

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

Posted by: Mohanbabu17 on: 7/29/2010 [Member] Starter

Up
0
Down
Thanks man

Mohan

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

Login to post response