Simple question about data DataSet, DataView and DataGrid
-
Hi, I am working on a simple database project and I am confused about data bindings between DataSet, DataView and DataGrid objects. I connect to a database, I build my DataSet, I bind it to a DataView, which I bind to a DataGrid. My DataGrid displays my stuff correctly, but I was wondering how I can make a change to my DataView so that both my DataGrid and my DataSet will take these changes as well... And if I make a change to my DataGrid, will the change be present in both my DataView and My DataSet? And if I make a change to my DataSet, will it be reflected in the DataView and the DataGrid? How does all thes things work? Thank you very much!
-
Hi, I am working on a simple database project and I am confused about data bindings between DataSet, DataView and DataGrid objects. I connect to a database, I build my DataSet, I bind it to a DataView, which I bind to a DataGrid. My DataGrid displays my stuff correctly, but I was wondering how I can make a change to my DataView so that both my DataGrid and my DataSet will take these changes as well... And if I make a change to my DataGrid, will the change be present in both my DataView and My DataSet? And if I make a change to my DataSet, will it be reflected in the DataView and the DataGrid? How does all thes things work? Thank you very much!
You can also bind a dataset to a datagrid directly
DataSet dataSet=new DataSet();
DataGrid1.DataSource=dataSet;Similarly, at anytime, you can bind the contents of a datagrid to a dataset.
DataSet dataSet=new DataSet();
dataSet = (DataSet)DataGrid1.DataSource;Keshav Kamat :) India