Cache
-
is it possible to keep a Dataset in Cache( Page or Application or Fragment) like session Thanks in advance
-
-
is it possible to keep a Dataset in Cache( Page or Application or Fragment) like session Thanks in advance
-
This Example will help you. In the following sample a file is read in Application_Start (defined in the Global.asax file) and the content is stored in a DataView object in the application state. C# void Application_Start() { DataSet ds = new DataSet(); FileStream fs = new FileStream(Server.MapPath("schemadata.xml"),FileMode.Open,FileAccess.Read); StreamReader reader = new StreamReader(fs); ds.ReadXml(reader); fs.Close(); DataView view = new DataView(ds.Tables[0]); Application["Source"] = view; } function Application_Start() : void { var ds:DataSet = new DataSet(); var fs:FileStream = new FileStream(Server.MapPath("schemadata.xml"),FileMode.Open,FileAccess.Read); var reader:StreamReader = new StreamReader(fs); ds.ReadXml(reader); fs.Close(); var view:DataView = new DataView(ds.Tables[0]); Application("Source") = view; }
Regards, Satips.