Text version of the video
http://csharp-video-tutorials.blogspo...
Slides
http://csharp-video-tutorials.blogspo...
All ASP .NET Text Articles
http://csharp-video-tutorials.blogspo...
All ASP .NET Slides
http://csharp-video-tutorials.blogspo...
All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenka...
All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatAr...
In parts 119 to 125 of the asp.net video tutorial, we discussed about
1. Caching webforms
2. Caching multiple responses of webforms
3. Fragment caching using user controls
4. Caching multiple versions of usercontrols
Please watch these videos, from the asp.net video tutorial using the link below
http://www.youtube.com/playlist?list=...
In this video we will discuss about caching application data. It is possible to store application data in the web server memory, using the CACHE object, so that the data can be retrieved faster. For example, let us say, we have a stored procedure that takes 5 seconds to execute and return data. We can cache the data returned by this stored procedure with in an asp.net web application using the CACHE object, so that, next time when we try to access the data, we can get it from the cache, rather than reprocessing the stored procedure again.
We will be using "tblProducts" table for this demo. If you need the script to create and populate this table, please refer to Part 122, using the link below.
http://csharp-video-tutorials.blogspo...
Text version of this video is present at the following link
http://csharp-video-tutorials.blogspo...
The following stored procedure takes 5 seconds to execute and return data. We are using WAITFOR DELAY, to introduce artificial query processing time of 5 seconds.
CREATE Procedure spGetProducts
as
Begin
Waitfor Delay ' 00:00:05'
Select * from tblProducts
End
Copy and paste the following code in WebForm1.aspx.cs. The code is well documented and is self explanatory.
protected void btnGetProducts_Click(object sender, EventArgs e)
{ DateTime dtStartDateTime = DateTime.Now; System.Text.StringBuilder sbMessage = new System.Text.StringBuilder(); // Check if the data is already cached if (Cache["ProductsData"] != null) { // If data is cached, retrieve data from Cache using the key "ProductsData" DataSet ds = (DataSet)Cache["ProductsData"]; // Set the dataset as the datasource gvProducts.DataSource = ds; gvProducts.DataBind(); // Retrieve the total rows count sbMessage.Append(ds.Tables[0].Rows.Count.ToString() + " rows retrieved from cache."); } // If the data is not cached else { // Get the data from the database DataSet ds = GetProductsData(); // Cache the dataset using the key "ProductsData" Cache["ProductsData"] = ds; // Set the dataset as the datasource gvProducts.DataSource = ds; gvProducts.DataBind(); sbMessage.Append(ds.Tables[0].Rows.Count.ToString() + " rows retrieved from database."); } DateTime dtEndDateTime = DateTime.Now; sbMessage.Append((dtEndDateTime - dtStartDateTime).Seconds.ToString() + " Seconds Load Time"); lblMessage.Text = sbMessage.ToString();
}
private DataSet GetProductsData()
{ string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; SqlConnection con = new SqlConnection(CS); SqlDataAdapter da = new SqlDataAdapter("spGetProducts", con); da.SelectCommand.CommandType = CommandType.StoredProcedure; DataSet dsProducts = new DataSet(); da.Fill(dsProducts); return dsProducts;
}
In this video, we discussed about storing application data in cache, using direct assignment. That is using a key and assiging value to it, as shown below.
Cache["ProductsData"] = ds
In our next video, we will discuss about all the other options that are available, to store data in the Cache object.
asp.net core docker Caching application data in asp net Part 126 | |
| 83 Likes | 83 Dislikes |
| 36,840 views views | 524K followers |
| Education | Upload TimePublished on 7 Feb 2013 |
Related keywords
wcf vs web api,ado.net core,cachingconnectionfactory,sql server management studio,webkinz,webadvisor,craigslist nj,caching headers,wcf one piece,asp.net core 3,4.0kw,ajax players,weber grill parts,webtoon,tutorials by hugo,csharp corner,mvc design pattern,asp.net machine account,servers for minecraft,asp.net core dependency injection,ado.net tutorial,services angular,ajax ontario,caching server,asp.net mvc tutorial,4.0 パッチノート,caching meaning,asp.net cos'è,csharp assembly,4.0 メインクエスト,tutorialspoint python,sql join,services briefcase,asp.net core web api,ajax jquery,wccftech,craigslist ny,asp.net zero,csharp foreach,server memes,sql date format,services online,chase,serverless architecture,server resume,wcf c#,server books,tutorialspoint javascript,mvcc connect,ado.net mysql,services technologies gps,ajax deadpool,server jobs,cvs,website,4.05 秘伝書,mvc tutorial,costco hours,wcf service application,tutorialspoint spring,serverless,wcf soap,wcf cat,cool math games,wcf test client,caching issue,services & training hse colombia sas,servicestack,citibank,asp.net core identity,sql union,ajax parking,sql database,4.00-8,caching plugin,asp.net core logging,mvconnect,cunyfirst,asp.net guida,wcf nba,csharp download,wcfi foundation,csharp online,wcf authentication,tutorials near me,http://asp.net,server 2019,chernobyl,ado.net descargar,web of dreams,serverminer,ajax cleaner,caching in .net core,ado.net visual studio 2019,webassign,ado.net vs entity framework,ado.net visual studio 2017,caching sound effect,csharp list,sql like,asp.net mvc,asp.net core tutorial,sqlite,wcfm,ajax roster,mvc architecture,http://ado.net,asp.net core mvc,ajax soccer,server hosting,wcfi,4.0 新式 素材,ajax dish soap,4.0kw エアコン,4.05 新式 素材,capital one,server rack,tutorialspoint html,csharp interface,craigslist,webroot,tutorialspoint reactjs,ajax request,wcf dragon ball,asp.net core 2.2,tutorialspoint python 3,sql developer,webster,services transmission company sas,sql group by,asp.net core signalr,services manager,4.0 秘伝書,mvc framework,ajax paving,mvc near me,tutorialspoint spring boot,mvc map,csharp online compiler,asp.net download,sql between,ado.net c# pdf,services tag dell,wcf 2019 nba,csharp switch,ado.net ventajas y desventajas,csharpstar,wcf tutorial,tutorialspoint,ajax meaning,csharp-video-tutorials.blogspot,tutorials dojo,central park 5,caching_sha2_password' cannot be loaded,csharp string format,ado.net c#,asp.net core github,server status,ajax fc,server jobs nyc,asp.net core swagger,sql formatter,credit karma,services group,caching in spring boot,server error in '/' application,services windows,asp.net core 3.0,sql injection,tutorialspoint c#,wcf ria services,calculator,ado.net entity data model,sql insert,tutorialspoint tableau,services google play apk,4.00-18,sqlyog,4.05 新式,asp.net core 3 release date,sql server,4.0 零式,4.00-10,server job description,tutorials by a,servicenow,webcam,mvc hours,webmd symptom,csharp array,4.0 ff14,caching game,csharp enum,ajax call,asp.net core 2. guida completa per lo sviluppatore,asp.net core,server pro,server status ffxiv,cheap flights,webcrims,asp.net core hosting,services sas,tutorialspoint java,tutorialspoint java compiler,webmd,caching pronunciation,csharp to json,college football,ado.net dataset,csharp dictionary,catching fish,cnn,website builder,tutorialspoint sql,asp.net web api,server side rendering,weber grills,sql server 2017,tutorialspoint spark,mvc nj,ado.net oracle,asp.net core download,csharp to vb.net,webster bank,caching proxy,webstaurant,caching in rest api,tutorialsystems,ajax post,services fms publish announcement,services.msc no abre,ajax jersey,csharp operator,asp.net core razor pages,4.0オンス,server duties,asp.net core environment variables,caching strategies,csharp random,century 21,services consultores,services consulting,mvcsd,services.msc,mvcsc,ado.net pdf,asp.net core configuration,ajax marvel,sql update,asp.net tutorial,mvc medical,ado.net entity data model visual studio 2019,caching algorithms,wcfs international curriculum,mvc2,caching supplies,ado.net entity data model visual studio 2017,4.0 新式,caching_sha2_password,chase online,wcf api,costco,server jobs near me,webex,sql meaning,sql tutorial,4.0マクロ関数,sql commands,ado.net entity framework,ajax tavern,tutorialsteacher,ajax javascript,services desk,ajax greek,4.01,csharp tutorial,mvc pattern,ado.net sql server,ado.net connection,4.0 新式 実装,caching data,4.05,asp.net identity,mvcu,asp.net core middleware,wcf web service,mvc webadvisor,web store,mvcc,webmail,mvci,mvctc,
Không có nhận xét nào:
Đăng nhận xét