Hi,
I ned to dump data from a grid to a dataset to update a new DB, I have created the dataset, The problem I am having is getting the data from the grid Can anyone explain how I can dump the grid into my dataset?
Thanks,
George
Hi,
I ned to dump data from a grid to a dataset to update a new DB, I have created the dataset, The problem I am having is getting the data from the grid Can anyone explain how I can dump the grid into my dataset?
Thanks,
George
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Bechir BejaouiPosted Nov 16, 2008, 7:32 PM
datatable dt = ds.tables.add(...)
then you have to dimension the data grid
for(int i =0;i
datagridview1.columns.add("column" + i.tostring(),"column" + i.tostring());
}
for(int i =0;i
datagridview1.Rows.add();
}
once the datagridview is dimensioned
then you create double boucle that assign each value entred in the datagridview to the data table
dt[index][index]<-- datagridview[index,index].value
George LaingPosted Nov 16, 2008, 9:50 AM
Hi,
The datagrid does have a datsoource but the member field is empty.
Thanks
Bechir BejaouiPosted Nov 16, 2008, 9:17 AM
you do use an unbound datagrid to fill a data table
George LaingPosted Nov 15, 2008, 6:55 PM
Hi,
In this case the datagrid was filled by a xml file, I want to put the changes from the grid to a new dataset. I can't seem to get the grid to load a new dataset.
Thanks
Bechir BejaouiPosted Nov 15, 2008, 6:37 PM
datagridVew.datasource = yourdataset;
datagridview.datamember = dataset.tables[0].TableName;
Normally, the datagridview and your data set are tied, am I miss understand you?
George LaingPosted Nov 15, 2008, 6:09 PM
Bechir BejaouiPosted Nov 15, 2008, 12:45 PM