first i need to check whether key is present in database table or not,
If it is not thr means i need to insert one key in table and after that i need to retrive data.
I need to compare datime which is present in table and present time ,if it is lessthan means i need to retrive from table else i need to reinsert data to table and retrive from it Plz send sample code
well, You can have the class level dataTable object and use it as long as you need it but you may want to use SQLDependecy object to handle the change in database (so that you need not to keep polling database periodically).
Without no sqldependency object and having datatable object cached doesn't make sense. (Just a thought).
By the way, if your application N-tier (or Hosted), you may want to handle the multiple changes made to database from different users.
Which cache are you talking about? Cache is a technology that you can use for any purpose. In .NET framework, you can store a copy of data in the memory as well, that can help as a cache. To store the datatable, store the entire object in the memory.
SatishPosted Mar 10, 2017, 11:15 AM
Plz send sample code
Tapan PatelPosted Mar 10, 2017, 9:08 AM
Afzaal Ahmad ZeeshanPosted Mar 10, 2017, 9:00 AM