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 5955661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:08:44+00:00 2026-05-22T18:08:44+00:00

I am using IIS7 and c# and mysql. and I put some objects into

  • 0

I am using IIS7 and c# and mysql. and I put some objects into asp.net cache system with sql keywords. it has very simple logic.put the selected dataset into cache with the given sql keyword.

here is the problem. when I call my site with http://www.abc.com it works normal. while surfing in abc.com after second click firstly filled dataset becomes empty datasets and my site start showing empty lists.

I tried changing keys to some static words and copy datasets then cache them but no success so far.

I hope I explained well. http://beta.mpazari.com is the place if you like to see and at red boxes dropdowns is the lists should have been filled with data.

here is the my fill function

public void Fill(ref DataSet ds, string sql, DateTime? cacheTime, string key)
    {
        if (key == null) key = sql;
        if (cacheTime == null) cacheTime = DateTime.Now.AddMinutes(generalCacheExpiarionTimeInMinutes);
        if (cache[key] != null) { ds = (DataSet)cache[key]; return; }
        MySqlConnection conn = new MySqlConnection(ConfigurationManager.ConnectionStrings["motorConnectionString"].ConnectionString);
        try
        {
            conn.Open();
            MySqlDataAdapter myda = new MySqlDataAdapter(sql, conn);
            if (ds == null) ds = new DataSet();

            ds.Clear();
            myda.Fill(ds);
            cache.Insert(key, ds.Copy(), null, cacheTime.Value, System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.NotRemovable,null);
        }
        finally
        {
            conn.Close();
        }
    }

thanks in advance.

  • 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-22T18:08:45+00:00Added an answer on May 22, 2026 at 6:08 pm

    Which Cache are you using? ASP.NET has several places that you can cache…I would suspect that you might be putting this in the cache that is disposed of at the end of each request.

    See these…
    http://msdn.microsoft.com/en-us/library/system.web.httpcontext.cache.aspx
    (Context Cache…persists for the life of the app domain)

    http://msdn.microsoft.com/en-us/library/system.web.httpcontext.items.aspx
    (Request Cache…persists until the end of the Request)

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

Sidebar

Related Questions

No related questions found

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.