Tuesday, 31 March 2009

Get Response in DataSet

DataSet GetResponse(string str_BlogUrl)
{


WebResponse ObjWebResp;
WebRequest ObjWebReq;
StreamReader ObjReader;
XmlTextReader xmlread;


ObjWebReq = WebRequest.Create(str_BlogUrl);
ObjWebReq.Timeout = 6000;
ObjWebResp = ObjWebReq.GetResponse();
ObjReader = new StreamReader(ObjWebResp.GetResponseStream());

xmlread = new XmlTextReader(ObjReader);

DataSet ds = new DataSet();
ds.ReadXml(xmlread);

ObjReader.Close();
ObjReader.Dispose();
ObjWebResp.Close();
return ds;
}

No comments:

Post a Comment