DataView how to bind a master-slave table data set returned by a Web service
Source: Internet
Author: User
Working with the Data View Web part
microsoft® Office frontpage® 2003
Author:ben
Msn:benjamine65@hotmail.com
How to use DataView to invoke XML Web Services
How to display a parent-child from a table
L Design Objectives:
The Data View binds the dataset returned by the Web service, displays the parent table, and, with the current record associated with the parent table, is evaluated as a condition, nesting the child table
L data Structure (The following example is an example of the Northwind sample database for SQL Server 2000):
L Sample Web Service:
if: Http://localhost/AspNetSample/Service1.asmx Web Services, where the key code is:
[WebMethod]
Public DataSet Getdatasource (string tablename)
{
DataSet ds = new DataSet ("Datasettables");
DataTable dt = new DataTable ();
DataTable Dtcus = new DataTable ();
Sql
DT = SqlHelper.ExecuteDataset (ConnectionString, CommandType.Text, "select top * from Orders"). Tables[0];
Dt. tablename = tablename;
Dtcus = SqlHelper.ExecuteDataset (ConnectionString, CommandType.Text, "select top * from Customers"). Tables[0];
Dtcus.tablename = "Customers";
Ds. Tables.add (dt. Copy ());
Ds. Tables.add (Dtcus.copy ());
return DS;
}
L Add data Source Catalog with FrontPage 2003:
1. Open Task Pane. Drop-down Menu View-> task pane or shortcut key ctrl+f1, select Data Source pane in Task Catalog, expand XML Web Services and click Add to Catalog ...
2. In the pop-up Data Source Properties window, fill out the contents of the General page, give the current source name, such as: Getdatasource; Fill in the source page content, Service Description location for Http://localhost/AspNetSample/Service1.asmx?WSDL, OK after connect now! If the Web services settings are correct, the associated service Name, Operation, and so on in connection info will be displayed, and we are now choosing Getdatasource in Operation, Set the Getdatasource interface parameters; The last thing to set up is the login method for the login page. OK when finished, Getdatasource icon appears under XML Web services
3. Drag Getdatasource to a Web Part zone of the page
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service