什么是OLEDB的与SQLCLIENT利弊? [英] What are the pros and cons of OleDB versus SQLClient?

查看:514
本文介绍了什么是OLEDB的与SQLCLIENT利弊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些背景:我工作的其中一个系统是一个.NET 2.0的Web应用程序。 VB.net为前端,和SQL Server 2005的后端。适用于各种已失去了时间的原因,原设计者决定使用。NET OLEDB连接而不是SqlClient连接。

Some context: one of the systems I'm working on is a .net 2.0 web application. VB.net for the front end, and SQL Server 2005 for the backend. For a variety of reasons that have been lost to time, the original designer decided to use the .Net OleDB connection rather than the SQLClient connection.

经过短短几年的发展,这项制度是在越过门线从试用到1.0地位的风口浪尖。的事情之一,我们一直在谈论这一点正在向SqlClient连接。虽然我知道,这是最好的做法来使用它,而且它的获得在SQL Server 2005中的票友功能(我们不使用,显然)什么是使用一个以上的优势的唯一途径其他?任何隐藏的陷阱我应该知道的?而且任何人都可以在一些标准,表示相对速度指向我? (我听到,SQLCLIENT应该是快,但我从来没有见过任何数字做后盾的时候了。)

After a few years of development, this particular system is on the cusp of crossing the line from "beta" into "1.0" status. One of the things we've been talking about at this point is moving to the SQLClient connection. While I'm aware that it's best practice to be using it, and that it's the only way to get at the fancier features in SQL Server 2005 (which we aren't using, obviously) what are the advantages of using the one over the other? Any hidden gotchas I should know about? And can anyone point me at some benchmarks showing relative speeds? (I hear that the SQLClient is supposed to be faster, but I've never seen any numbers to back that up.)

感谢所有。

推荐答案

OleDb的是更通用。如果你移动到不同的数据库类型,在未来有一个很好的机会,这将有一个OLE驱动程序,你将不必改变尽可能多的code。

OleDb is more generic. If you ever move to a different database type in the future there's a good chance it'll have an Ole driver and you won't have to change as much code.

在另一方面,SQL Server本机驱动程序应该是快如你所说,它有更好的参数支持(参数可以使用名称,并且没有的有无的是按顺序)。

On the other hand, the Sql Server native driver is supposed to be faster as you said and it has nicer parameter support (parameters can use names and don't have to be in order).

在我个人的经验,我从来没有注意到的速度差,所以像你,我找不到任何做后盾的时候了。我怀疑的性能优势是真实的,但你必须处理数百万条记录之前,你可以开始测量。

In my personal experience, I've never noticed the speed difference, so like you I couldn't find anything to back that up. I suspect the performance advantage is real, but that you'd have to process millions of records before you could start to measure it.

我也注意到,作出了有意义的差异有错误消息。我遇到了麻烦与一个老OleDb的应用程序,我换到的SqlClient出于绝望。它仍然没有工作,当然,但所提供的更好的错误信息足够多的新信息,我能解决这个问题。

What I did notice that made a meaningful difference were the error messages. I was having trouble with an old OleDb app, and I switched it to SqlClient out of desperation. It still didn't work, of course, but the better error messages provided enough new information that I was able to fix the problem.

这篇关于什么是OLEDB的与SQLCLIENT利弊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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