.Net中的数据提供者 [英] Data Providers in .Net

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

问题描述

亲爱的所有人,

我对数据提供者有一个小疑问.

为什么我们使用Orcaledb,SqlClient等不同的提供程序来实现不同的数据库连接,我想知道是否存在使用不同提供程序的任何特定原因.
谢谢,
Sreekanth

Dear All,

I had a small doubt regarding the data providers.

Why we are using different providers like Orcaledb, SqlClient for diferrent database connectivity, I want to know is there any specific reason of using different providers.

Thanks,
Sreekanth

推荐答案

因为每个数据库系统的工作方式不同.它们是相同的总体计划,并且相同的SQL可以(几乎)保持不变.但是实际的界面是不同的.例如,对于SQLCE数据库,您不能使用存储过程.可以创建一个通用"接口,但随后您必须记住要使用哪个接口才能正确使用SQL.

有点像汽车:左手驾驶和右手驾驶.它们的驱动方式相同,但是使用不同的手来换档并操作手刹.
Because each database system works differently. They are the same general plan, and the same SQL will work (pretty much) unchanged. But the actual interface is different. For example, with an SQLCE database you can''t use Stored Procedures. It would be possible to make a "generic" interface, but then you would have to remember which one you are using to get the SQL right.

It''s a bit like cars: Left hand drive and right hand drive. They are both driven the same way, but using different hands to change gear and work the handbrake.


不同的提供商由不同的人员维护,并针对各自的RDBM平台进行了优化. >
由于不同的基础连接语义(例如数据包端口等),它们不能完全相同.

为了使自己与这些隔离,可以使用IDBconnectionIDBCommand等通用接口,并在运行时传递实现,即在不更改代码的情况下更改不同的RDBM.
Different providers are maintained by different people and are optimized for their respective RDBM platform.

They cannot be all the same because of different underlying connection semantics such as packets ports etc.

To isolate yourself from these you can use the generic interfaces such as IDBconnection, IDBCommand etc. and pass the implementation at runtime ie change for different RDBMs without changing your code.


DataProviders充当桥接器,用数据库吸引您的应用程序.

中看到图片 CP文章.
希望它会清除更多.
DataProviders works as a Bridge to intract your application with database.
see a picture in
CP Article.
Hope it will clear more.


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

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