473,651 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

best way of using session variables to store datatable?

VMI
When my webpage loads the first time, I fill my datatable with records from
the DB and display them in my gridview. Once it loads, the user clicks on a
button and add records to the datatable, which also show up in the gridview.
When "Finish" is clicked, I'll insert the records into the DB.
Question: What's the best way to display the datatable (with the records
from the DB and the records that the user added through the page) into the
gridview after postback? And when the user's done, how can I know which
records from the datatable were added by the user?

Thanks
Aug 29 '06 #1
1 2874
VMI,
This is really an ASP.NET question (not a C# language question) and should
be directed to the ASP.NET group.

If your code really adds a new Grid row to the underlying datatable, you
should only need to get this out of session state and pass it to a
DataAdapter to update your database.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"VMI" wrote:
When my webpage loads the first time, I fill my datatable with records from
the DB and display them in my gridview. Once it loads, the user clicks on a
button and add records to the datatable, which also show up in the gridview.
When "Finish" is clicked, I'll insert the records into the DB.
Question: What's the best way to display the datatable (with the records
from the DB and the records that the user added through the page) into the
gridview after postback? And when the user's done, how can I know which
records from the datatable were added by the user?

Thanks
Aug 29 '06 #2

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

Similar topics

15
7651
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not there at all? Any feedback would be helpful. Thanks! -Josh
6
2271
by: Perdit | last post by:
My 1st page calls a 2nd that uses same data from a database. What is the best way to get the data in the second: a new call to the database or passing array through session variable?? I seems to me that avoiding a new call will speed up things but my concerne is that I have read many posts with caution messages againts session vars. Has anybody tested session var stability in this common scenario?
2
2509
by: Max | last post by:
This is the best method I've found to store and load settings from database. I load the settings once at start as public variables. The method can be called easily anytime you want to load the new settings from database. Comments very welcome... I'd like to refine this... besides the error handling I need to add for the db conn... Global.asax --------------- Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) Dim...
3
2689
by: Yul | last post by:
Hi, We are in the process of designing an ASP.NET app, where a user will enter some 'Customer ID' to be queried in the database. If the ID is valid, several stored procedures will be called to populate multiple webpages containing customer information. There isn't a one-to-one correlation between the stored procedure and a webpage. In other words, a webpage may have to refer to 1 or more DataTables to populate itself. Therefore, a...
1
2941
by: LilC | last post by:
I'm creating an application that has a standard layout for all pages. The information that is displayed in the layout will be dynamic based on the user that is logged in. Thus when a page is browsed to, I need to check to see if the user has logged in or not. Then if they have logged in, I need to pull their information from the database to display in the header. In previous applications, I made use of a base web page that all the...
9
7287
by: david | last post by:
I have a class with some business-logic and with every roundtrip, I need an instance of this class, so I have to create it, every time again. That doesn't seem very efficient. I thought it would be 'better' to store an instance of this class in a session-variable, so it's available all the time and needs to be instanced only once. Is this, generally speaking, a good idea, storing objects in session-variables ? Do you guys ever use this...
11
3022
by: john_c | last post by:
I'd like to store information for roles in Session variables. RoleA has a specific set of values, RoleB has a specific set and so one. When I access values for RoleA, it looks like this: Session = "30" Session = "1000" Session = "5" Session = "10" and similar for the other roles. Those values are initially loaded
3
1980
by: Nemisis | last post by:
Guys, I would like to write a error handler, or something, that will allow me to write to a database when an error occurs on my site. I am trying to implement this in the global.asax file a the moment, but am having problems when a 404 error occurs, i cant access sessionstate. Is writing this code in the global.asax file the best way to do this? I have been searching on the net and hear alot about httphandlers? Will a httphanlder...
1
2152
by: Andy | last post by:
I want to store a key in an ASP.NET session variable that points to an ASP.NET page cache. The page cache contains an XML document that holds a draft of the user's work. After the user is finished with their draft, it gets posted and permenantly saved in the database. If the session timesout after a few minutes of idlement, the user doesn't loose their work when the page cache is set to have a far longer timeout. The user just has to...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8695
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8460
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6157
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1906
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.