热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

为什么要从ADO切换到ADO.NET?-WhyswitchfromADOtoADO.NET?

Ihavesomefriendswhoareold-schoolVB6databasedevelopersandIwastellingthemabout.NETa

I have some friends who are 'old-school' VB6 database developers and I was telling them about .NET and its features, specifically ADO.NET.

我有一些朋友是'老派'VB6数据库开发人员,我告诉他们有关.NET及其功能,特别是ADO.NET。

In our conversation, they brought up the following reasons why they would rather stick with ADO than move to ADO.NET:

在我们的对话中,他们提出了以下原因:为什么他们宁愿坚持ADO而不是转向ADO.NET:

  • The Dataset is disconnected (What if power fails?)
  • 数据集已断开连接(如果电源出现故障怎么办?)

  • The same amount of code still has to be written
  • 仍然需要编写相同数量的代码

  • The new options of Dataset, BindingSource and TableAdapter seem confusing
  • Dataset,BindingSource和TableAdapter的新选项似乎令人困惑

  • the same code is written programatically access the Database, all that changes is how that command is laid out
  • 以编程方式访问数据库编写相同的代码,所有更改都是该命令的布局方式

I'm looking for answers or reasons why ADO.NET is 'better' than ADO with regards to data access when it comes to Windows Forms applications. What does ADO.NET provide that ADO does not? What does it do better than ADO?

我正在寻找答案或理由为什么ADO.NET在Windows Forms应用程序方面的数据访问方面比ADO“更好”。 ADO.NET提供的ADO不是什么?它比ADO做得更好?

NB: I'd like examples that do not involve LINQ.

注意:我想要不涉及LINQ的示例。

8 个解决方案

#1


On the one hand, if it ain't broke, don't fix it. But on the other - VB6? Really? Sounds like ADO vs. ADO.NET is small potatoes here...

一方面,如果没有破损,请不要修理它。但另一方面 - VB6?真?听起来像ADO与ADO.NET这里的小土豆......

I think the issue is more VB vs. VB.NET and then the whole code-base, skill-set, other-non-technical-considerations come into play here.

我认为问题更多的是VB与VB.NET,然后整个代码库,技能组合,其他非技术考虑因素在这里发挥作用。

#2


ADO is unsupported COM-based technology. VB 6.0 is end of life unsupported technology as of March 2008. DAO, RDO, ADO are all technologies that are nearly a decade past their prime.

ADO是不受支持的基于COM的技术。截至2008年3月,VB 6.0是生命周期不受支持的技术.DAO,RDO,ADO都是近十年的技术。

ADO.NET is a modern toolset for data access. In particular, LINQ to SQL and the Entity Framework take data access to new heights.

ADO.NET是一个用于数据访问的现代工具集。特别是,LINQ to SQL和实体框架使数据访问达到了新的高度。

#3


There's nothing wrong with using ADO in legacy VB6 applications. And if these applications are functioning correctly there's no reason to change them.

在旧版VB6应用程序中使用ADO没有任何问题。如果这些应用程序运行正常,则没有理由更改它们。

I don't think anyone programming in .Net will be too tempted to try to use ADO since it feels like such a hack job when you try to. Just let them be.

我认为.Net中的任何编程都不会试图使用ADO,因为当你尝试时感觉就像这样的黑客工作。让他们成为。

#4


Simple answer: don't convince them...

简单回答:不要说服他们......

Have them look at LINQ to SQL (or better yet LINQ to Entities)

让他们看看LINQ to SQL(或者更好的LINQ to Entities)

#5


One of the biggest issues that was able to get people to switch to ADO.NET at my day job was the fact that ADO (VB6 flavor) is all COM, you get better performance with ADO.NET.

在我的日常工作中能够让人们切换到ADO.NET的最大问题之一是ADO(VB6风格)都是COM,使用ADO.NET可以获得更好的性能。

#6


I heard a rumor that the VB6 runtime will not ship after Windows 7...

我听说有传言称VB6运行时不会在Windows 7之后发布......

#7


I'm guessing if the recordset is still connected and the power goes out on the server, the user would get prompted immediately in their app before they continue to enter data that won't get saved?

我猜测记录集是否仍然连接并且服务器上的电源耗尽,用户会在他们继续输入无法保存的数据之前立即在他们的应用中得到提示?

How about memory garbage collection?

内存垃圾收集怎么样?

Distributing updates is easier in .net.

在.net中更容易分发更新。

I guess if you have a lot of code in VB 6 for winform apps why change? Maybe if you start a new project using VB.NET you can show some other benefits like including multiple tables in a table adapter (Can't say I've taken advantage of that).

我想如果你在VB 6中有很多代码用于winform应用程序,为什么要改变?也许如果你使用VB.NET开始一个新项目,你可以展示一些其他的好处,比如在表适配器中包含多个表(不能说我已经利用了它)。

#8


I prefer ADO.NET myself, but just for balance, there is one advantage of classic ADO over ADO.NET: it is arguably more usable.

我自己更喜欢ADO.NET,但为了平衡,经典ADO优于ADO.NET有一个优点:它可以说更有用。

Our customers found it difficult to use [ADO.NET] because of the extensive initialisation it requires. Even in the simplest scenarios, users are expected to understand complex interactions and dependencies between several types... Note that many of these problems were addressed in the .NET framework 2.0.

我们的客户发现很难使用[ADO.NET],因为它需要广泛的初始化。即使在最简单的场景中,用户也应该理解几种类型之间的复杂交互和依赖关系......请注意,许多这些问题都在.NET framework 2.0中得到解决。

Written by the architects of the .NET framework, in the .NET Framework Design Guidelines 2nd Edition page 25.

由.NET框架的架构师编写,在.NET Framework设计指南第2版第25页中。


推荐阅读
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有