January 2003
Intermediate to advanced
896 pages
19h 58m
English
Now we’ll look at creating a Web service capable of receiving a DataSet object and passing changes all the way back to a SQL Server database for update. To do so, you can add a new Web method to the Web service class that takes a DataSet object as one of its arguments. Inside the method, you call the Update method of an SqlDataAdapter object that has been given suitable SqlCommand objects for the InsertCommand, DeleteCommand, and UpdateCommand properties. The sample code for the XML Web service looks like this:
[WebMethod]
public DataSet UpdateTimeSheet(DataSet dsUpdate)
{
sqlDataAdapter2.Update(dsUpdate);
return dsUpdate;
}Refer to Chapter 15 for details of how the Update method of the SqlDataAdapter ...
Read now
Unlock full access