SQL Sql连接和OLEDB连接的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7130332/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 11:46:55  来源:igfitidea点击:

Difference between Sql Connection and OLEDB Connection

sqlsqlconnectionoledbconnection

提问by Abdul Rahman

What is the difference between the SQL Connection and OLEDB Connection? Is that OLEDB is common to all (also SQL Server)? To which are all Servers, OLEDB is using?

SQL 连接和 OLEDB 连接有什么区别?OLEDB 对所有人(也是 SQL Server)是通用的吗?OLEDB 使用的是哪些服务器?

回答by Naga Harish M

The advantage of using OleDbConnectionis flexibility. You can change your database (for instance, move to Oracle)and not have to change your code.

使用OleDbConnection的优点是灵活性。您可以更改您的数据库(例如,移动到 Oracle)而不必更改您的代码。

If you using SQLServer as backend then use SQLConnectionfor better performance.

如果您使用 SQLServer 作为后端,则使用SQLConnection以获得更好的性能。

check with this link http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/fadb2742-d75a-49fb-a839-b2d4a9183998/

检查此链接http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/fadb2742-d75a-49fb-a839-b2d4a9183998/

OleDbConnection : You can connect to any database, which you have provide for that.

OleDbConnection :您可以连接到您为此提供的任何数据库。

Tip: use Universal Data LinkFile

提示:使用通用数据链接文件

enter image description here

在此处输入图片说明

回答by Simon D

SqlConnection is designed to access SQL Server, while OleDbConnection is designed to access any database.

SqlConnection 旨在访问 SQL Server,而 OleDbConnection 旨在访问任何数据库。