Results 1 to 2 of 2

Thread: Save datatable as XML file??

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    Save datatable as XML file??

    I have a datagrid "Datagrid1" whos source is a datatable "dtTable"

    I keep adding rows to the grid with the following:

    Dim rowP As DataRow
    rowP = dtPickle.NewRow()
    rowP(0) = Me.txtCode.Text
    rowP(1) = Me.txtDescription.Text
    rowP(2) = Me.txtQuantity.Text
    dtPickle.Rows.Add(rowP)

    I want to put a button on my form which will save this as an XML file which
    I want to use as the source for a crystal report.

    Any Ideas???

    Parksie

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    The DataSet has a pair of methods, .GetXML and .GetXMLSchema - Datatable is SOL. .GetXML and Schema are really simple to use, as are .ReadXML and ReadXMLSchema incidentally.

Posting Permissions

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



Click Here to Expand Forum to Full Width