Copy data to SQl Table
-
Hi All, I am trying to read data from a certain URl .Every time you run the Url with Different param it gives a result like the following. For instance runinng http://data.com/data.aspx?datefrom=20090601&dateto=20090621 will give a result of a comman separated data like the following. "john","wood","20090203" "terry",'brown",20090209" etc.. How will i read that and get it in to Sql Table?All i have to run is the above URL to generate the value. Please advice. Thank you in advance
-
Hi All, I am trying to read data from a certain URl .Every time you run the Url with Different param it gives a result like the following. For instance runinng http://data.com/data.aspx?datefrom=20090601&dateto=20090621 will give a result of a comman separated data like the following. "john","wood","20090203" "terry",'brown",20090209" etc.. How will i read that and get it in to Sql Table?All i have to run is the above URL to generate the value. Please advice. Thank you in advance
Call this URL using WebRequest class methods. You will get the string output from url. Sample code to call URL
string strUrl = "http://www.abc.com/a.aspx";
Uri url = new Uri(strUrl);
string strFinal = url.ToString();
WebRequest objWebReq = WebRequest.Create(strFinal);
WebResponse objWebRes = objWebReq.GetResponse();
Stream objStream = objWebRes.GetResponseStream();
StreamReader objStreamReader = new StreamReader(objStream);
string strHTML = objStreamReader.ReadToEnd();Now write a logic over a string to save data into SQL
Regards Aman Bhullar www.arlivesupport.com[^]