473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need help with storing dataset in session variable

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.
Nov 20 '05 #1
4 2170
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" <hp*****@hotmail.com> wrote in message
news:22**********************************@microsof t.com...
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.

Nov 20 '05 #2
And I thought you did web for a long while

DataGrid1.DataSource(ds)

:-))))))

Cor
Nov 20 '05 #3
not a single datagrid in there (all done w trees)
:p

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:OU*************@TK2MSFTNGP11.phx.gbl...
And I thought you did web for a long while

DataGrid1.DataSource(ds)

:-))))))

Cor

Nov 20 '05 #4
> > >
DataGrid1.DataSource(ds)


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
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike | last post by:
Hey guys I am pulling my hair out on this problem!!!!! Any help or ideas or comments on how to make this work I would be grateful! I have been working on this for the past 4 days and nothing I do...
2
by: headware | last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design question regarding the use of web services and APS.NET applications. Right now we have an application that uses web services to...
7
by: Spencer H. Prue | last post by:
Hello!, I have a using system.web.sessionstate directive one the top of each of two web pages. On the first page I have the dataadapter, dataconnection, and dataset (also in the component tray)....
2
by: Al Wilkerson | last post by:
Hey guys, I'm having problems with creating/storing a value in a session variable for later retrieving on another page. Here is the aspx page where I create/store the value ...
3
by: Aaron | last post by:
Why do my session values return to nothing on post back? I want to click a button and have the row, as in: dataset.table(0).rows(THIS ROW NUMBER IS WHAT I AM TALKING ABOUT), either increment or...
3
by: sista via DotNetMonster.com | last post by:
hi.. just wondering what does this error means? here's my vb code: Imports System.Web.Security Imports System.Data Imports System.Data.OleDb Public Class dpitem Inherits System.Web.UI.Page
8
by: rk2008 | last post by:
I have an ASP.NET application, which needs to initialize a memory location and update it multiple times in different projects in the same solution. I have used a public static variable and I could...
3
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
2
by: RoFaR | last post by:
I have a dataset, dinamically I create a table and fill them with data, then I add the table to the dataset, The dataset is stored in a session variable. Later When I access the dataset from the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.