Cache XML Dataset
Here is a quick way to retrieve configuration data from an XML files (not web.config) in ASP.NET. This supports caching and is quick and efficient.
public static DataRow LoadXML(string XMLFileName)
{
DataSet ds1;
if (HttpContext.Current.Cache[XMLFileName] == null)
{ //not in cache so we create it
ds1 = new DataSet();
ds1.ReadXml(XMLFileName);//read it
HttpContext.Current.Cache.Insert(XMLFileName, ds1,
new CacheDependency(XMLFileName));//save it
}
else //or load it from cache
{
ds1=(DataSet) HttpContext.Current.Cache[XMLFileName];
}
DataRow r=ds1.Tables[0].Rows[0];
return r;
}
datarow r = LoadXML(@"c:\\file.xml");
string foo=r["blahColumn"];
1 Comments:
When we are performing a routine look at, we have data to show that your chosen account happen to be involved in the problematic transactions. It is best to take even more attention to any banned having email, that will secure your play, it should you check out account supervision to safe your condition.
Post a Comment
<< Home