WCF中的数据库连接 [英] Data base connection in WCF

查看:213
本文介绍了WCF中的数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是V.Phani Kumar目前致力于移动开发,
我正在WCF上工作.
我想如何在WCF中建立数据库连接代码.

谢谢与问候,
V.Phani Kumar

This is V.Phani Kumar presently working on mobile developement,
I am working on WCF.
I would like how to make a database connection code in WCF.

Thanks & Regards,
V.Phani Kumar

推荐答案



数据库连接是ADO.NET的一部分,而不是WCF的一部分.您可以创建一个单独的数据库层来处理db事务,并在通过操作contact实现的方法中调用其方法.要进行错误处理,请与WCF一起使用错误约定.
Hi,

Database connection is part of ADO.NET not of WCF.You can create a separate database layer to handle db transaction and call its methods in methods implemented of operation contact.For error handling Use fault contract with WCF.




如果服务合同必须连接到数据库,那么我们应该如何编写代码,如果我们为数据库连接提供工厂类,或者为WCF中的数据库连接提供任何特定的库,则该如何编写.

谢谢和问候
V.Phani Kumar


If the service contract has to connect to the database, How should we write the code should we factory classes for database connections or else any specific libraries for the database connection in WCF.

Thanks and regards
V.Phani Kumar


这篇关于WCF中的数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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