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:
Code
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
Mahesh ChandRank #1 · 393K pointsPosted Sep 16, 2008, 4:59 AM EDT
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?
Nalini B2 pointsPosted Apr 22, 2009, 3:44 AM EDT