M
Morten Snedker
Hi folks,
I'm trying to get the actual content of a datagridview into Excel. It
seems to me that the most easy way is to use the WriteXML property of
a dataset.
So that's what I'm trying, but I'm getting it wrong when trying to get
the grids datasource into the dataset.
Firstly, is using the DataSet.WriteXML an okay approach?
And anyhow, what I'm I doing wrong:
Dim ds As New DataSet
ds = Me.DataGridView1.DataSource
Dim fs As New System.IO.FileStream("d:\test.xml",
IO.FileMode.CreateNew)
ds.WriteXml(fs)
fs.Close()
fs.Dispose()
ds.Dispose(
The problem is that the original dataset that puts data to the grid
has been disposed at this current time...
Thanks in advance for any help.
Regards /Snedker
I'm trying to get the actual content of a datagridview into Excel. It
seems to me that the most easy way is to use the WriteXML property of
a dataset.
So that's what I'm trying, but I'm getting it wrong when trying to get
the grids datasource into the dataset.
Firstly, is using the DataSet.WriteXML an okay approach?
And anyhow, what I'm I doing wrong:
Dim ds As New DataSet
ds = Me.DataGridView1.DataSource
Dim fs As New System.IO.FileStream("d:\test.xml",
IO.FileMode.CreateNew)
ds.WriteXml(fs)
fs.Close()
fs.Dispose()
ds.Dispose(
The problem is that the original dataset that puts data to the grid
has been disposed at this current time...
Thanks in advance for any help.
Regards /Snedker