Need help with storing dataset in session variable

G

Guest

I have developed a windows application in VB.NET and now want to take parts of it and put it on the web, so although I understand all about datasets etc, I know little about web development

My issue is that I have a grid bound to a dataset, and I have a text box under the grid where users can enter a new value. They then click the ADD button and I want the result to be added to the dataset and thus appear in the grid. When the user first opens the page the grid is empty. Unfortunately each time I add a new item, it forgets all the other items that have been enetered so I can only ever have one line in the grid

I know that I can store a dataset in the session by using Session.Add but how can I firstly make the grid use the session variable as its datasource and secondly how do I add or modify the dataset stored in the session variable

Any tips, or advise would be much appreciated.
 
E

EricJ

you will have to do that in code

not tested but should be somthing like this

in the page load

ds = Session.Item("yoursessionDS")

DataGrid1.DataSource(ds)



hope it helps



Huw Lloyd said:
I have developed a windows application in VB.NET and now want to take
parts of it and put it on the web, so although I understand all about
datasets etc, I know little about web development.
My issue is that I have a grid bound to a dataset, and I have a text box
under the grid where users can enter a new value. They then click the ADD
button and I want the result to be added to the dataset and thus appear in
the grid. When the user first opens the page the grid is empty.
Unfortunately each time I add a new item, it forgets all the other items
that have been enetered so I can only ever have one line in the grid.
I know that I can store a dataset in the session by using Session.Add but
how can I firstly make the grid use the session variable as its datasource
and secondly how do I add or modify the dataset stored in the session
variable.
 
C

Cor Ligthert

Because I thougth someone has once fight with that never forget anymore
DataGrid1.databind after that (not that I know where it is for, however when
you forget that it does nothing)

(Not important, just some prickling however it missed because you did not
use that datatagrid, I expected you would see that direct).

Cor
 

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

Similar Threads


Top