|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
HELP: Edit a DataSet (not DataGrid)I have a DataGrid which has checkbox columns. The data source is a run-time
created data set that I store in a session so I can rebind it during postbacks. I don't have a database or xml file, etc. I am wondering if it's possible to edit a dataset directly? So when I click on a checkbox it will change the value in the dataset and store it back into session? If this is not possible how can I use arrays or vectors to temporary store my checkbox statuses? I guess it's not possible to have one DataGrid have more than one datasource... Hi,
Yes it is possible. Suppose you have a dataset named northwindDataSet and it has one table named Customers in it. Then to change a field on a specific row (first row for this sample) of Custommers you should write something like: northwindDataSet.Tables["Customers"].Rows[0]["CustomerID"] = "ALFZI"; Note that here CustomerID is a field on Customers table. Then you can store dataset in session state. Show quote "Dhruba Bandopadhyay" <dhruba.bandopadh***@hotmail.com> wrote in message news:uBNdsdlfGHA.3364@TK2MSFTNGP05.phx.gbl... >I have a DataGrid which has checkbox columns. The data source is a run-time >created data set that I store in a session so I can rebind it during >postbacks. I don't have a database or xml file, etc. > > I am wondering if it's possible to edit a dataset directly? So when I > click on a checkbox it will change the value in the dataset and store it > back into session? > > If this is not possible how can I use arrays or vectors to temporary store > my checkbox statuses? I guess it's not possible to have one DataGrid have > more than one datasource... > > |
|||||||||||||||||||||||