473,385 Members | 1,483 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,385 software developers and data experts.

Generic list stored in session....??

ASP.NET 2.0

My webpage has a GridView showing rows from a table in the database. All
these rows are stored in the session object -what's actually stored is
generic list of objects, as this:
List<Messagemessages = null;
messages = (List<Message>)HttpContext.Current.Session[sessionKey];

The user should be able to mark one or several rows in the GridView and
select Delete. I wonder how I should implement deleting of the rows. Okay I
need a stored procedure doing the database update. But the rows displayed on
GridView are stored in the session (first check if messages are null, if so
then read from database again).... So if not the session object gets a
update the delete will have no effect.

In other words:
When I delete I must do 2 things: Delete from the database table. AND remove
the deleted item from the session object...

I wonder how this should be done! When using cache it is possible to
configre dependancy, but (from what I understand) cache is shared among all
the users... The GridView shows rows specific for this user. No other user
should be able to see them...

How do I loop through this list "List<Messagemessages" and delete objects
having a specific value?
(Lets say I have to loop through the session object and remove the deleted
rows from the List<Messagemessages )

Any suggestions??

Jeff
Apr 16 '07 #1
0 1819

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

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
5
by: Alberto Giménez | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I have a simple question, and after a *very long* google search I still can't get it. It's about generic abstract data types (for...
2
by: Wysiwyg | last post by:
I was hoping to get some opinions on the efficiency of various methods of reusing the same dropdown list data. Here is the situation: Multiple panels on maintenance pages with TAB menus across...
0
by: webmaster | last post by:
Pardon my being a total C# noob. I'm trying to take apart the dotNet Time Tracker dotNet C# starterkit sample application and replicate a part of the code. At a high level, I have a very...
1
by: Kuldeep | last post by:
Framework: Visual Studio 2005, ASP.NET Programing Language: C#.NET I am using a Generic List Collection to fetch a particular master data from the database. Once collected, I use this Collection...
2
by: Jeff | last post by:
ASP.NET 2.0 In the business logic layer I've got the code (see CODE) below, this code gives a compile error (see ERROR) CODE: List<Messagemessages = null; messages =...
7
by: Abhishek | last post by:
Hi I am using a generic list in my program to have a list of objects stored. I want to compare all the objects in this list with object of another class and find all the objects which meet the...
13
by: rkausch | last post by:
Hello everyone, I'm writing because I'm frustrated with the implementation of C#'s generics, and need a workaround. I come from a Java background, and am currently writing a portion of an...
3
by: BombDrop | last post by:
Can any one help I have a method that will return a List to be bound as a datasource to a combobox see code for population below. I get the following error when i try to compile Error 29 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.