Video instructions and help with filling out and completing When Form 8815 Cashing

Instructions and Help about When Form 8815 Cashing

Hello welcome to premium technologies I am venket this is part 1 1 9 of asp.net video series in this video we'll discuss about cashing in asp.net cash improves the performance and scalability of an application caching is the technique of storing frequently used data or pages in memory let's understand caching practically with an example let's flip to sequel server management studio we will be using this TBL products table in this demo so let's go ahead and create this table and this table has got three columns ID name and description of the product and let's go and insert some sample data into this table using this insert script and finally let's go ahead and create the stored procedure which simply returns ID name and description columns from TBL products table ok and now since this is a very simple table with 4 columns within that I mean with 4 rows within that when we execute the stored procedure the stored procedure will be executed in less than a second look at the time it took less than a second now in real time we may have tables with huge amounts of data and we may be joining multiple tables so the queries before they actually return data they might take some time so obviously to introduce some artificial query processing times I'm going to use wait for delay in sequel server so there's something called wait for delay so we are intentionally blocking the execution of this stored procedure for you know certain duration I want to block it for 0 overs 0 minutes and 5 seconds okay so basically hours minutes and seconds so we are blocking the execution of this stored procedure for 5 seconds so let me go in and alter the stored procedure ok so now if we execute the stored procedure as you might expect it's going to take at least 5 seconds look at this it's still executing query 3 seconds 4 seconds until it's 5 seconds we won't get the data back ok so now let's go ahead and invoke the stored procedure from an asp.net web application so let's flip to visual studio on this web form let's go ahead and drag and drop a grid view control which can display the data from TBL products table okay and then let's go ahead and auto format this so that it looks a little better and then along with the data I also want to print the server-side time and client-side time okay and to print the server-side time I'm going to have a label control here so let's drag and drop a label control onto this waveform and let's get rid of that default text label okay alright so what we basically want to do is in this grid view control we want to invoke that Stewart procedure and display the data from TBL products table and just to speed things up I have this ad or dotnet code already typed again in this video we're discussing about caching we discussed about a do net in a do dotnet video tutorial and sequel server concepts like creating tables executing stored procedures etc in sequence of a video tutorial if you're new to sequel server and you know ad or dotnet I strongly recommend to watch videos you know in sequence of a video tutorial ad or dotnet tutorial that can be found at the link that you can see here on the slide ok so now let's go and copy this ad or dotnet code which is simply is going to execute this SP get products stored procedure that we have just written ok so if you look at this area dot not code it's pretty simple and straightforward all we are doing is reading the connection string from web config file so within web config file we are reading this DB connection string you know connection string and then storing it that in this variable connection string which we are then using to create a signal connection object and we are using sequel data adapter object to execute this SP get product stored procedure which we have just returned and we are telling the command type a stored procedure and creating a new data set filling that data set with the data I know that we get after executing this SP get product stored procedure and then we are setting the data set as the data source for the gridview invoke the data bind method and finally I also want to set the text of this label one control so if you look at this on on on this waveform we have this label one control you know on which I want to print the current date and time on the web server and to do that I'm setting text property of this label to date/time dot now which is going to give me the current date and time on the web server and then convert that to string okay so we have the date and time from the web server but on the client machine how do we retrieve the date and time on the client machine now we know that HTML and JavaScript they get executed or interpreted on the client machine on the client browser okay so obviously to retrieve the current date and time on the client machine I can use the JavaScript code ok so here within the aspx of this waveform I'm going to spit you know JavaScript code here next to client time now look at this on the server side if you want to write something to the response stream how do we do that we use the response dot write method similarly if you want to write something using JavaScript then I can use the document object of JavaScript in all of the browser so I'm going to use the document object and then this document object so