Datagrid to XML

Results 1 to 2 of 2

Thread: Datagrid to XML

  1. #1
    Join Date
    Dec 1969

    Default Datagrid to XML

    I want to transfer the contents of the datagrid to an XML document? how do i do this??

  2. #2
    Join Date
    Dec 1969

    Default RE: Datagrid to XML

    If your datagrid is bound to a dataset, you can use the following:<BR><BR>&#060;%@ Import NameSpace="System.Xml" %&#062;<BR><BR>Sub SaveIt()<BR><BR>Dim strXML as String<BR><BR>strXML = objDataSet.GetXml()<BR><BR>ViewState("strData")= strXML<BR><BR>End Sub<BR><BR>To retrieve it (Assuming in this example you put it in viewstate).<BR><BR>Sub GetIt()<BR><BR>strXML = ViewState("strData").ToString()<BR><BR>Dim strReader As New System.IO.StringReader(strXML)<BR><BR>objDataSet.R eadxml(strReader)<BR><BR>End Sub<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts