Cache Nasil Kullanilir – 3

Bu dersimizde Application Cache kullanimina bir ornek veriyoruz.

Video: Application Cache

Category: ASP.NET  Tags: , , ,
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
One Response
  1. Alper diyor ki:

    Selam Bu metodu gride object data source olarak ekledim ama tam burada ds = ((DataSet)(cache["names"]));>>>> “Object reference not set to an instance of an object.” bu hatayı alıyorum neden olabilir.

    public static class Listeler
    {
    static Cache cache = new Cache();
    public static DataSet Get(int isApproval, int jobTypeID, int isInvoiceApproval)
    {

    DataSet ds;
    ds = ((DataSet)(cache["names"]));

    if (ds == null)
    {
    string path = “JobSma.xml”;
    var j = new JobRepositoy();
    j.Criteria = “SELECT ……………….. FROM …………………….. WHERE (Retailer.RetailerCode IS NOT NULL) AND (Jobs.IsApproval = @p1) AND (Jobs.JobTypeID = @p2) AND (Jobs.IsInvoiceApproval = @p3) ORDER BY Jobs.JobID DESC”;
    j.Parameters.AddWithValue(“@p1″, isApproval);
    j.Parameters.AddWithValue(“@p2″, jobTypeID);
    j.Parameters.AddWithValue(“@p3″, isInvoiceApproval);
    j.GetJoinedEntities().WriteXml(path);

    ds = new DataSet();
    ds.ReadXml(path);
    CacheDependency cd = new CacheDependency(path);
    cache.Insert(“names”, ds, cd);
    //Trace.Warn(“XML den Yüklendi!”);
    }
    else
    {
    //Trace.Warn(“Cache’den Yüklendi!”);
    }

    return ds;
    }
    }

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>