Hello people, I've got a problem. Can anybody tell me how can I save data from DataGridView through Dataset to XML? I've found many useful codes that could solve problem like this:
Dataset ds = new Dataset();
ds = (Dataset) (DataGridViewXY.Datasource);
ds.WriteXml("XML_name.xml");
!but actually! it doesn't work because when I run program it all stops at ds = (Dataset) (DataGridViewXY.Datasource); saying something like cannot assign Dataset to DataGridView...
What can I do? Isn't there problem that my DataGridView data are bound? How can I change this property/option?
Any hints?
Matej
Nalini BPosted Apr 22, 2009, 7:44 AM
Mahesh ChandPosted Sep 16, 2008, 8:59 AM
You can't get data from a DataGridView like this. Don't you already have a DataSet or some kind of data before you display data in a DataGridView?
What is the source of your data?