Categories
Website Stats to Date
Hits: 7,433,718
Visitors: 3,272,154
Widgets Viewed: 2,442,690
Active Users 19
We Accept PayPal®
Widget #CS0197
Storing a DataSet in a Session Variable (ASP.NET)
Free
Dim DB As New System.Data.OleDb.OleDbConnection() Dim DA As System.Data.OleDb.OleDbDataAdapter Dim DS As New System.Data.DataSet() ''WHEN THE PAGE IS LOADED CHECK FOR A VALUE IN THE SESSION VARIABLE ''IF NOT FOUND LOAD THE DATA FROM THE DATABASE AND STORE IT IN A SESSION VARIABLE FOR LATER USE. If IsNothing(Session("Categories")) Then DB = Session("DBCon") Dim SQL As String = "Select * From ProductCategories Order By Category" DA = New System.Data.OleDb.OleDbDataAdapter(SQL, DB) DA.Fill(DS) Session("Categories") = DS Session("DBCon") = DB DB.Close() DB = Nothing Else ''IF THE SESSION VARIABLE CONTAINS A DATASET THEN DON'T LOAD FROM THE DATABASE ''USING THE DATASET FROM THE SESSION VARIABLE REDUCES DATABASE ACCESS DS = Session("Categories") End If DGrid.DataSource = DS DGrid.DataBind()
Last Updated: 4/27/2018
HTML Article
Online Document
License
No Restrictions
Re-Distribution Permitted This source code is provided to you "as is" without warranty CLICK HERE FOR TERMS OF USE Copyright 2000-2006 Comrie Software Solutions
(0) Items $0.00
Featured Widgets
WebStore
Online Store
ASP.NET Application Template
More...
ShoppingCart
WebUserControl (ASP.NET)
Calendar Reports
Microsoft® Access (Monthly View)
Online Voting/Survey
.. this is one site that believes in Customer Service. I had questions, I had answers quickly. No "wait for days", No "buy this and find out". Just courteous and HELPFUL answers. It is refreshing to find a site that really cares about their products and stands behind them! And their products perform as they promote them.John L.
When I received my ASP.NET E-Commerce application it was for the purpose of marketing my software inventory via the internet. It took a minimal amount of time to launch it and offers host of traffic tracking options for further market study and analysis. Overall an excellent product. Richard G.
This website uses Cookies to store User information and Shopping Cart Items for the duration of your visit to CodeWidgets.com.
No Credit Card or Financial information is stored by CodeWidgets.com. Click Here For Our Complete Privacy Policy and Terms of Use.