i am trying to use this code to write the contents of a DGV to a file but it is leaving out the last coloumn of data when it writes the xml file.

vb.net Code:
  1. Dim ds As DataSet = CType(DataGridView2.DataSource, DataSet)
  2.                 ds.WriteXml(SaveFileDialog1.FileName & ".xml")