9.3. Round-Triping DataSets

Now that you know how to create typed DataSets, let's look at a Web service and a Windows Forms client that use typed DataSets to send data back and forth over the Internet. Listing 9.7 shows a Web method called SaveCustomerOrdersTypedDataSet that receives a DataSet, uses it to update the Customers and Orders tables, and returns the refreshed DataSet. This method complements the GetCustomerOrdersTypedDataSet method in Listing 9.4.

Listing 9.7. A method to save changes to the database (VBWSBook\Chapter9\CustomerOrders.asmx)
 <WebMethod()> _ Public Function SaveCustomerOrdersTypedDataSet( _ ByVal ds As CustomerOrdersDataSet) _ As CustomerOrdersDataSet Dim Sql1 As String = _ "SELECT CustomerID, CompanyName FROM Customers" ...

Get Real World XML Web Services: For VB and VB .NET Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.