调用WCF服务来绑定WPF Datagrid [英] Calling WCF Service to bind WPF Datagrid

查看:124
本文介绍了调用WCF服务来绑定WPF Datagrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,

我是WCF的新手,WPF。我的问题是我必须使用WCF服务来绑定我的WPF Datagrid Control.And我必须在WCF服务的帮助下在WPF Datagrid中执行插入,更新和删除。任何人都可以帮助我使用带有数据网格的示例WPF项目,该项目使用WCF服务进行插入,更新和删除操作。我使用sql server 2008作为我的后端

Dear Friends,
I am New to WCF,WPF . And My Question is I have to Use WCF Service for binding my WPF Datagrid Control.And I have to perform insert,update and delete in WPF Datagrid With the help of WCF Service . Can anyone help me with a sample WPF project with datagrid that consumes WCF Service for insert,update and delete operations . I am using sql server 2008 as my back end

推荐答案

您需要在需要绑定数据网格的事件中调用该服务,如Load事件。



当您在WPF中调用WCF时,您需要在WPF上创建一个WCF客户端以便访问服务方法,以便您可以获取绑定所需的数据数据网格。



例如...



如果你有服务名为service1和引用为WPF中的MyServiceExample ..

需要创建客户端对象,如MyServiceExampleServiceClient clientObject = new MyServiceExampleServiceClient();



那么你将能够访问返回绑定网格的服务方法的方法。





- 阿丽亚娜
You need to call the service in the event where you need to bind the datagrid like Load event.

When you will call the WCF in WPF you need to create a WCF client at WPF So as to access the service methods, So that you can get the data which is needed to bind the data grid.

For Example...

If you have service named service1 and references as MyServiceExample in WPF..
Client object needed to be created like MyServiceExampleServiceClient clientObject=new MyServiceExampleServiceClient();

Then you will be able to access the methods which returns service methods which binds grid.


--Ariana


你好,我将从这个链接开始:



http://www.codearsenal.net/2012/09/wcf-service-and-wpf-client-datagrid.html#.Us_cSfRdXsk [ ^ ]



本教程介绍如何使用WCF服务作为WPF网格的数据源,我目前正在为此添加数据库,



问候,



尼克
Hi, I would start off by using this link:

http://www.codearsenal.net/2012/09/wcf-service-and-wpf-client-datagrid.html#.Us_cSfRdXsk[^]

This tutorial shows how to use a WCF service as a data source for a WPF grid, I am currently working on a adding a database to this,

Regards,

Nick


这篇关于调用WCF服务来绑定WPF Datagrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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