HELP: Edit a DataSet (not DataGrid)

  • Thread starter Dhruba Bandopadhyay
  • Start date
D

Dhruba Bandopadhyay

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...
 
K

Kerem OZMAN

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top