Monday, April 23, 2007

नमस्ते !
This small piece of code is very helpful when you want to do repetative tasks of Fetching an XML and forming a dataset out of it.

public DataSet FetchDataSet(string fetchXml)
{
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
string strResult = service.Fetch(fetchXml);

DataSet ds = new DataSet();
StringReader reader = new StringReader(fetchXml);
ds.ReadXml(reader);
return ds;
}

Cheers - Dipesh

No comments: