如何:WCF服务导航 [英] how to: WCF services navigation

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

问题描述

你好

我正在使用n层应用程序(数据访问层,WCF,Presentation(asp.net))制作WCF服务程序C#

我有一个页面,您可以在其中修改记录,但是我直接连接到数据库,并且不使用数据集.在此页面上,有3个texbox用于修改用户.
我想找出一种方法,可以使用该页面中的按钮浏览数据库,如果要修改用户,则可以使用它.

如果您建议使用数据集,那么我需要刷新数据集,以便在添加新记录时,修改"页面知道有新记录吗?

hello

i am making a wcf service program with n tier app (dataaccess tier, WCF, Presentation(asp.net))C#

i have a page where you can modify a record but i am directly connected to the database and im not using a dataset. On this page there are 3 texboxes to modify the users.
I want to find out is there a way to navigate through database with buttons in that page and if you want modify a user you are on then its posssible.

if you maby suggest to use a dataset then someway i need to refresh the dataset so if i added a new record the "modify" page knows there is a new record?

推荐答案

最好在将对象映射到数据库关系表的情况下使用LINQ to SQL

然后使用操作合同"可以通过将服务调用发布到WCF服务来修改对象,在您的具体实现中,可以使用数据上下文修改对象

导航类似,从服务调用返回对象列表并将其绑定到gridview
It will be best to use LINQ to SQL where you map objects to your database relational tables

Then using Operation Contracts you can modify your objects by posting a service call to your WCF services, in your concrete implementation, modify your objects using data context

The navigation is the similar, return a list of objects from your service call and bind them to the gridview


这篇关于如何:WCF服务导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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