Last post Jun 11, 2011 03:34 AM by tatau
Jun 06, 2011 07:08 AM|nazanin_a|LINK
i have a web page , and in my web page , i have a panel, i read from a xml file and show data in that panel, but now i dont want to read from that xml file
directly, i want to read from that xml file one time in a day , forexample every 12 p.m and put data into database and then read from database and show them in my panel
protected void Page_Load(object sender, EventArgs e)
WebRequest req = WebRequest.Create("http://irimo.ir/farsi/RSS/xml.asp");
WebResponse resp = req.GetResponse();
DataSet ds = new DataSet();
grdweather.DataSource = ds.Tables.DefaultView;
, would you please help me?
and here is my code:
Jun 06, 2011 07:14 AM|Shakti Singh Tanwar|LINK
1.) Create an xml file on server with data from your link.
2.) Create a CacheDependency on xml file and put item in Cache with expiration time of 1 day.
3.) Now change your page_load code to fetch data from Cache if present there and if first time load data from xml..
For cachedependency refer
Jun 07, 2011 09:41 PM|Decker Dong - MSFT|LINK
Hello, here's my suggestion:)
1) As my understand your problem, I suggest you trying to use something like DataTable (if your xml contents are very regular and it can be converted into DataTable, that'd be better) in the C# Service(by creating such a service app).
2) When arrival to the 12 PM, you should use DataTable.Load(your xml path) into DataTable first, and then use foreach loop to access each row with each specific column and get their values. And with the help of SqlConnection+SqlCommand, you can do inserting
3) Then your webservice should also work to fetch the modified data and you can use what codes you've got now to show them.
Jun 11, 2011 03:34 AM|tatau|LINK
do you have a reference for #1 ? I would like to create or write an xml file on the web server from a link to an xml file from another site, the reason, it loads too slow from the exterenal site which is only updated once a day anyway