Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4589132
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:01:20+00:00 2026-05-21T22:01:20+00:00

I always wondered how exactly you’d handle caching of database-values (in C#, ASP.NET) so

  • 0

I always wondered how exactly you’d handle caching of database-values (in C#, ASP.NET) so you e.g. don’t reload several DataSource-Bound ASP-Controls or don’t have to reload them everytime you use a certain backend method.

Let’s just take the following example:

aspx.cs-File:

List<FormElement> elements = FormElement.GetForForm(Session["FormName"].ToString());

Backend-Method:

public static List<FormElement> GetForForm(string fName)
    {
        DataTable dt = new DataTable();
        SqlCommand cmd = new SqlCommand("select Rank, Control, Variable from inspire.dbo.formelement where formid=(select id from inspire.dbo.form where name=@name)", Database.Conn);
        cmd.Parameters.Add(new SqlParameter("@name", fName));
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        da.Fill(dt);
        return dt.Rows.ToList<FormElement>(item => new FormElement(item));}

How exactly would I handle caching here?

Thanks,

Dennis

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T22:01:20+00:00Added an answer on May 21, 2026 at 10:01 pm

    what we have done for the caching:

    1. in page side, use a global container (eg. dataset) to store all the required data, each data add a time flag for it

    2. in backend side, use a same container to store the data, and also with the time flag

    3. when page refresh, compare the time flag with current datetime, get data from that container;

      or send a refresh_fetch to backend side, backend will get data from db and update caching content for its container, then send back the updated data to page

    4. page update its container and display out

    the flow is simply like this, however, based on real situation, the container, the refresh strategy… maybe different

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've always wondered, lets say you have two asp.net websites running in the same
I'm using Telerik RadControls for ASP.NET and wondered if there was any way to
I always wondered how doe's server upload and download works exactly... for example when
I've always wondered why websites don't offer a variable password option, in which a
I always wondered how JavaScript stores null values internally. null is different than any
I have used MySQL a lot, but I always wondered exactly how does it
I always wondered how an XML parser handle the check of a URI namespace.
I always wondered why js compressors don't do this. Let's say I have a
I always wondered why there is no sort(v);// same as std::sort(v.begin(),v.end()) If I recall
I always wondered how much I should test my code (with unit tests). Let's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.