Getting Started
  Introduction
  What is ASP.NET?
  Language Support

ASP.NET Web Forms
  Introducing Web Forms
  Working with Server Controls
  Applying Styles to Controls
  Server Control Form Validation
  Web Forms User Controls
  Data Binding Server Controls
  Server-Side Data Access
  Data Access and Customization
  Working with Business Objects
  Authoring Custom Controls
  Web Forms Controls Reference
  Web Forms Syntax Reference

ASP.NET Web Services
  Introducing Web Services
  Writing a Simple Web Service
  Web Service Type Marshalling
  Using Data in Web Services
  Using Objects and Intrinsics
  The WebService Behavior
  HTML Pattern Matching

ASP.NET Web Applications
  Application Overview
  Using the Global.asax File
  Managing Application State
  HttpHandlers and Factories

Cache Services
  Caching Overview
  Page Output Caching
  Page Fragment Caching
  Page Data Caching

Configuration
  Configuration Overview
  Configuration File Format
  Retrieving Configuration

Deployment
  Deploying Applications
  Using the Process Model
  Handling Errors

Security
  Security Overview
  Authentication & Authorization
  Windows-based Authentication
  Forms-based Authentication
  Authorizing Users and Roles
  User Account Impersonation
  Security and WebServices

Localization
  Internationalization Overview
  Setting Culture and Encoding
  Localizing ASP.NET Applications
  Working with Resource Files

Tracing
  Tracing Overview
  Trace Logging to Page Output
  Application-level Trace Logging

Debugging
  The SDK Debugger

Performance
  Performance Overview
  Performance Tuning Tips
  Measuring Performance

ASP to ASP.NET Migration
  Migration Overview
  Syntax and Semantics
  Language Compatibility
  COM Interoperability
  Transactions

Sample Applications
  A Personalized Portal
  An E-Commerce Storefront
  A Class Browser Application
  IBuySpy.com

  Get URL for this page

Use Data in XML Web services

This sample shows how DataSets, a powerful new XML-based way to represent disconnected data, can be returned from a Web Service method. This is an extremely powerful use of XML 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.

The method GetTitleAuthors 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.

The method PutTitleAuthors 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.

 
VB DataService.asmx

[Run Sample] | [View Source]
 
VB DataService.asmx?wsdl

[View Sample]

The client application for this XML Web service calls GetTitleAuthors and binds the Authors table to a DataGrid control, as you'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.

 
VB DataServiceClient.aspx

[Run Sample] | [View Source]


Copyright 2001 Microsoft Corporation. All rights reserved.