Results 1 to 4 of 4

Thread: Code for Caching

  1. #1
    Join Date
    Dec 2008
    Posts
    30

    Code for Caching

    I want to store one or more value at a time and want to retrieve one by one i used the following code.

    string abc ="";
    while(reader.read())
    {
    str+=reader["names"].tostring();
    }

    cache["names"]=abc;

    how to split this names

    please guide me

    Thanks in advance

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Code for Caching

    I think there is something wrong in your problem statement are you trying to store all string values into one string after that you are going to store that string into cache object. After retrieving cache object you get entire string what you stored previously. What is it based on which you will split it.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Code for Caching

    Hi instead of using String why don't you use ArrayList, check whether the following code can solve your problem.

    using System.Collections;
    ArrayList abc = new ArrayList();

    while(reader.read())
    {
    abc.Add(reader["names"].tostring());
    }

    cache["names"]=abc;


    And the following code to get it one by one

    for (int i = 0; i < abc.Count; i++)

    {
    String str = abc[i].ToString();

    }

  4. #4
    Join Date
    Dec 2008
    Posts
    30

    Re: Code for Caching

    Thanks,
    I got it exactly as i wanted, actually i did as you told me and got it right.

Similar Threads

  1. Does Intel X79 Chipset going to get SSD caching
    By Diedrick in forum Motherboard Processor & RAM
    Replies: 8
    Last Post: 05-04-2012, 03:33 AM
  2. Intel Z68 system with SSD for caching
    By X-MaaN in forum Motherboard Processor & RAM
    Replies: 6
    Last Post: 04-08-2011, 11:27 PM
  3. Caching Records in Memory with ASP.NET
    By rashmi_ay in forum Software Development
    Replies: 5
    Last Post: 16-02-2010, 03:51 PM
  4. Adding Output Caching in IIS
    By Deepest BLUE in forum Software Development
    Replies: 3
    Last Post: 17-07-2009, 05:38 PM
  5. disk caching
    By in forum Windows Server Help
    Replies: 6
    Last Post: 10-12-2007, 10:07 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,554,161.52248 seconds with 17 queries