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

Get specific record in a cached list, how?

Hey

ASP.NET 2.0

I'm developing a web page displaying a list of messages, the code
(GetInboxMessages) below is the method which gives the a list of messages to
this web page's reapeat control

a message is text typed in by a user

a message contain these fields: Id, dataCreated, sender, receiver, body
sender and receiver is the foreign key to the users, sender is the person
sent the message, and receiver is the receiver of the message

In the repeat control the user should be able to click on a message and then
send a respond to the message clicked. When clicking on a message I want a
new web page to open displaying the message clicked and an area for the user
to type in a respond!

the PROBLEM is that I don't know how to get this specific message, I mean is
that in the first page (see the code below - GetInboxMessages) all messages
are saved in a cache (or is it?) and then it whould be needless to access
the specific message from the database. So how can I get the message from
the cache?

The only solution to this I know about is this:
List<Messagelist = GetInboxMessages(string user)
and iterate this list of message, using a foreach statement. test every
message until I find the message contain the Id of the message I'm looking
for.. But isn't there a better way in .NET 2.0 Generic?

public static List<MessageGetInboxMessages(string user)
{
List<Messagemessages = null;
string key = "InboxMessages";
if (BaseNetwork.Settings.EnableCaching && BizObject.Cache[key] != null)
{
messages = (List<Message>)BizObject.Cache[key];
}
else
{
List<MessageDetailsrecordset =
SiteProvider.Network.GetInboxMessages(user);
messages = GetMessageListFromMessageDetailsList(recordset);
BaseNetwork.CacheData(key, messages);
}
return messages;
}

Any suggestions?

Best Regards

Jeff
Oct 18 '06 #1
0 895

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

Similar topics

3
by: sean | last post by:
I have a table with fixed row of records SORTED by DATE using ADO pagination method. The user can click a link in one table cell and go to another page to modify the record. Once the updated record...
19
by: MaXX | last post by:
Hi, I hope I'm not OT. I have the following issue: I want to delete a record from my db with a php script. Let's say I'm auth'd and I want to delete the record id 440. With a simple form (get...
3
by: Cagey | last post by:
What I'm trying for: If this selection or if click on selection (highlighted line choice/ which ever selection change) w/in query's combo dropdown list box (on Switchboard), then Open in...
3
by: mckbill | last post by:
Is there a way I can direct the cursor to a specific field (variable) in a form by typing the field name while in form view? I have a form with many fields, and it would be nice if there were...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.