datagridview. 筛选_DataView如何绑定Web Service返回的主从表数据集

时间:2014-06-25  来源:Frontpage  阅读:
Working With the Data View Web Part
Microsoft® Office FrontPage® 2003
Author: Ben
MSN: benjamine65@hotmail.com
如何使用DataView调用XML Web Services
如何显示父子从表

l 设计目标:
Data View绑定Web Service返回的数据集, 显示父表, 同时以父表当前记录关联字估为条件, 嵌套显示子表
l 数据结构(以下例子以Sql Server 2000的Northwind示例数据库作例子):
l 样例Web Service:
如有: http://localhost/AspNetSample/Service1.asmx Web Services, 其中关键代码如:
[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 100 * from Orders").Tables[0];
dt.TableName = TableName;
dtCus = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, "select top 100 * from Customers").Tables[0];
dtCus.TableName = "Customers";

ds.Tables.Add(dt.Copy());
ds.Tables.Add(dtCus.Copy());

return ds;
}



l 利用FrontPage 2003添加Data Source Catalog:
1. 打开Task Pane. 下拉菜单View -> Task Pane或Shortcut key Ctrl+F1 , 在Task Pane选择Data Source Catalog, 展开XML Web Services并点击Add to Catalog…
2. 在弹出的Data Source Properties窗口, 填General页内容, 给当前数据源起个名字, 例如: GetDataSource; 填Source页内容, Service Description Location为http://localhost/AspNetSample/Service1.asmx?WSDL, OK后就Connect Now! 如果Web Services设置正确, 则在Connection Info里会显示相关的Service Name, Operation 等, 我们现在在Operation选GetDataSource, 设置一下GetDataSource的接口参数; 最后要设置的是Login页的Login方法. 完成后就OK, XML Web Services下就会出现GetDataSource的图标
3. 将GetDataSource拖到页面的一个Web Part Zone内

datagridview. 筛选_DataView如何绑定Web Service返回的主从表数据集

http://m.bbyears.com/wangyezhizuo/7341.html

推荐访问:datagridview 绑定数据
相关阅读 猜你喜欢
本类排行 本类最新