|
Hi Folks,
My webservice is returning some records and i am capturing the same in my database.Know If any one of the record changes in the webservice returned data i want to update the same in my table as well. Can you please let me know if you have any idea. Below is my sample code.
webserviceref.webservice Class PInstance = new webserviceref.webservice ();//Created an object for webservice
DataSet ds = PInstance.GetEmployees();//thewebservice class has a web method Get
Employees whichis returnted by the webservice and iam storing in a dataset
string sqlconnection = ConfigurationSettings.AppSettings["MyConnectionstring"].ToString();
foreach (DataRow dr in ds.Tables[0].Rows)
{
try
{
DatabaseCls.Parameter[] parameter = new GenericDBParameter[2];
parameter[0] = new Parameter("@Empid_ID", dr[0].ToString());
parameter[1] = new Parameter("@Emp_namee", dr[1].ToString());
DatabaseCls.ExecuteQuery.Execute(sqlconnection, "Mystoreprocedure.spInsert", parameter);
//This will insert the values in my table....
}
catch (Exception ex)
{
}
}
return "success";
}
Thanks,
SANDY
|