如何从wcf服务中的listview获取值到aspx.cs页面 [英] How to get the values from listview which is in wcf services to aspx.cs page

查看:66
本文介绍了如何从wcf服务中的listview获取值到aspx.cs页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上我在wcf服务中使用listview来存储数据。从那我想得到数据到aspx.cs页面是否可能或有没有办法从wcf到aspx.cs页面获取数据

Actually i am using the listview in wcf services to store the data. from that i want to get the data to aspx.cs page is it possible or is there any way to get the data from wcf to aspx.cs page

推荐答案

添加客户端应用程序中的Web引用,然后使用该服务。



例如,假设您的Web引用名为MyWebService,您要调用的服务是DataServiceClient,如下所示。您可以在首选项容器中返回结果,在本例中,我使用DataTable。



Add web reference in your client application, and then consume the service.

For instance, assume that your web reference is called MyWebService and your service you want to invoke is DataServiceClient, as seen below. You can return the result in your preference container, in this example, I use a DataTable.

public static DataTable GetData(int operationID)
        {
            DataTable dtResult;

            MyWebService.DataServiceClient client = new MyWebService.DataServiceClient();

            dtResult = client.GetData(operationID);

            client.Close();

            return dtResult;
        }


这篇关于如何从wcf服务中的listview获取值到aspx.cs页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆