home *** CD-ROM | disk | FTP | other *** search
- <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
-
- <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
-
- <h4>Using Data in Web Services</h4>
-
- This sample shows how DataSets, a powerful new XML-based way to represent disconnected data, can be returned in a Web Service
- method. This is an extremely powerful use of Web Services, as DataSets can store complex information and relationships in an
- intelligent structure. By exposing DataSets through a service, you can limit the database connections your data server is
- experiencing.
- <p>
-
- The method <B>GetTitleAuthors</B> connects to a database and issues two SQL statements: one that returns a list of authors,
- and another that returns a list of book titles. It places both result sets into a single DataSet called ds, and returns this
- DataSet.
- <p>
-
- The method <B>PutTitleAuthors</B> illustrates a Web Service method that takes a DataSet as a parameter, returning an integer that
- represents the number of rows received in the "Authors" table of the DataSet. Although the implementation of this method is
- somewhat simplistic, this method could also intelligently merge the passed data with the database server.
- <p>
-
- <table>
- <tr>
- <td>
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/services/DataService/DataService.asmx"
- ViewSource="/quickstart/aspplus/samples/services/DataService/DataService.src"
- Icon="/quickstart/aspplus/images/dataservice_asmx.gif"
- Caption="DataService.asmx"
- runat="server" />
- </td>
- <td>
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/services/DataService/DataService.asmx?SDL"
- Icon="/quickstart/aspplus/images/service_sdl.gif"
- Caption="DataService.sdl"
- runat="server" />
- </td>
- </tr>
- </table>
-
- <p>
- The client application for this Web Service calls GetTitleAuthors and binds the Authors table to a DataGrid control, as we've seen in
- previous examples. To illustrate the PutTitleAuthors method, the client removes three rows of data from the DataSet before calling
- this method, printing out the number of rows received by the service.
- <p>
-
- <Acme:SourceRef
- RunSample="/quickstart/aspplus/samples/services/DataService/DataServiceClient.aspx"
- ViewSource="/quickstart/aspplus/samples/services/DataService/DataServiceClient.src"
- Icon="/quickstart/aspplus/images/dataservice_client.gif"
- Caption="DataServiceClient.aspx"
- runat="server" />
-
- <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->