home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / aspplus / doc / servicesanddata.aspx < prev    next >
Encoding:
Text File  |  2000-06-08  |  2.5 KB  |  56 lines

  1. <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
  2.  
  3. <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
  4.  
  5. <h4>Using Data in Web Services</h4>
  6.  
  7. This sample shows how DataSets, a powerful new XML-based way to represent disconnected data, can be returned in a Web Service 
  8. method. This is an extremely powerful use of Web Services, as DataSets can store complex information and relationships in an 
  9. intelligent structure.  By exposing DataSets through a service, you can limit the database connections your data server is 
  10. experiencing.
  11. <p>
  12.  
  13. The method <B>GetTitleAuthors</B> connects to a database and issues two SQL statements: one that returns a list of authors, 
  14. and another that returns a list of book titles. It places both result sets into a single DataSet called ds, and returns this 
  15. DataSet.
  16. <p>
  17.  
  18. The method <B>PutTitleAuthors</B> illustrates a Web Service method that takes a DataSet as a parameter,  returning an integer that
  19. represents the number of rows received in the "Authors" table of the DataSet.  Although the implementation of this method is 
  20. somewhat simplistic, this method could also intelligently merge the passed data with the database server. 
  21. <p>
  22.  
  23. <table>
  24. <tr>
  25. <td>
  26. <Acme:SourceRef 
  27.   RunSample="/quickstart/aspplus/samples/services/DataService/DataService.asmx" 
  28.   ViewSource="/quickstart/aspplus/samples/services/DataService/DataService.src"
  29.   Icon="/quickstart/aspplus/images/dataservice_asmx.gif"
  30.   Caption="DataService.asmx"
  31.   runat="server" />
  32. </td>
  33. <td>
  34. <Acme:SourceRef 
  35.   RunSample="/quickstart/aspplus/samples/services/DataService/DataService.asmx?SDL" 
  36.   Icon="/quickstart/aspplus/images/service_sdl.gif"
  37.   Caption="DataService.sdl"
  38.   runat="server" />
  39. </td>
  40. </tr>
  41. </table>
  42.  
  43. <p>
  44. The client application for this Web Service calls GetTitleAuthors and binds the Authors table to a DataGrid control, as we've seen in 
  45. previous examples.  To illustrate the PutTitleAuthors method, the client removes three rows of data from the DataSet before calling
  46. this method, printing out the number of rows received by the service.
  47. <p>
  48.  
  49. <Acme:SourceRef 
  50.   RunSample="/quickstart/aspplus/samples/services/DataService/DataServiceClient.aspx" 
  51.   ViewSource="/quickstart/aspplus/samples/services/DataService/DataServiceClient.src"
  52.   Icon="/quickstart/aspplus/images/dataservice_client.gif"
  53.   Caption="DataServiceClient.aspx"
  54.   runat="server" />
  55.  
  56. <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->