首页 \ 问答 \ 为什么要从ADO切换到ADO.NET?(Why switch from ADO to ADO.NET?)

为什么要从ADO切换到ADO.NET?(Why switch from ADO to ADO.NET?)

我有一些朋友是“老派”的VB6数据库开发人员,我向他们讲述.NET及其功能,特别是ADO.NET。

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

  • 数据集断开(如果电源故障会怎么样?)
  • 仍然需要编写相同数量的代码
  • DatasetBindingSourceTableAdapter的新选项似乎令人困惑
  • 编写相同的代码以编程方式访问数据库,所有变化都是如何布置该命令

我正在寻找答案或理由,说明为什么ADO.NET在涉及到Windows Forms应用程序时比ADO在数据访问方面“更好”。 ADO.NET提供的ADO没有提供什么? 它比ADO做得更好吗?

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


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

In our conversation, they brought up the following reasons why they would rather stick with ADO than move to 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
  • 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?

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


原文:https://stackoverflow.com/questions/1160639
更新时间:2023-10-29 09:10

最满意答案

你所描述的是所谓的线性插值

对于一般情况,假设在ab之间有一个值c ,并且需要一个介于0和1之间的值,该值基于cab之间的相对位置。 x的等式如下:

x := (c - a) / (b - a)

因此,如果您的值在10到15之间(比如说11),并且您想要一个介于0和1之间的值,则可以将这些值插入上面的公式中:

x := (11 - 10) / (15 - 10)
x := 1/5

换句话说,11是从10到15的五分之一。


更为一般的情况(当你在ab之间有一个值c ,并且你希望yz之间有一个值x ), x的计算方法如下:

x := (c - a) * (z - y) / (b - a) + y

在你的情况下, z = 1y = 0


What you're describing is called linear interpolation.

For the general case, suppose you have a value c between a and b, and you want a value x between 0 and 1 which is based on c's relative position between a and b. The equation for x is as follows:

x := (c - a) / (b - a)

So if you have a value between 10 and 15 (let's say 11), and you want a value between 0 and 1, you punch the values into the equation above:

x := (11 - 10) / (15 - 10)
x := 1/5

In other words, 11 is one-fifth of the way from 10 to 15.


The even more general case (when you have a value c between a and b and you want a value x between y and z), x is calculated as follows:

x := (c - a) * (z - y) / (b - a) + y

In your case, z = 1 and y = 0.

相关问答

更多
  • Public Function Compare(r1 As Range, r2 As Range, r3 As Range) As Long Dim r As Range, v As Variant, m1 As Variant, m2 As Variant Dim rv As Long rv = 0 For Each r In r1 v = r.Value If v <> 0 And v <> "" And Not IsError(v) Then ...
  • 要保存图像,您可以使用SciPys imsave功能。 imsave(path, image) 编辑:要将图像另存为bmp ,请相应地选择path的文件扩展名。 编辑2:为了防止强度标准化,你可以使用 scipy.toimage(image, cmin=0, cmax=255, mode='I').save("image.png") 您可以使用mode'I'以特定格式保存图像。 请确保您的输入类型为uint16 。 To save an image you can use SciPys imsave f ...
  • 将非缩放对象放在单独的组中,然后根据组图层的缩放系数重新缩放(并可选择重新定位)该组。 演示: http : //jsfiddle.net/m1erickson/2X7eK/ var scaleFactor=2; // scale the entire layer by 2X layer.setScale(scaleFactor); // unscale just the noGroup back to original size noGroup.setScale(1/scaleFactor); ...
  • 你所描述的是所谓的线性插值 。 对于一般情况,假设在a和b之间有一个值c ,并且需要一个介于0和1之间的值,该值基于c与a和b之间的相对位置。 x的等式如下: x := (c - a) / (b - a) 因此,如果您的值在10到15之间(比如说11),并且您想要一个介于0和1之间的值,则可以将这些值插入上面的公式中: x := (11 - 10) / (15 - 10) x := 1/5 换句话说,11是从10到15的五分之一。 更为一般的情况(当你在a和b之间有一个值c ,并且你希望y和z之间有一个 ...
  • 您应该在imageview中使用layout_width =“match_parent”并添加adjustViewBounds =“true”,并让高度为wrap_content。 You should use layout_width="match_parent" and add adjustViewBounds="true" in imageview and let the height to be wrap_content.
  • 恐怕没有办法解决一些简单的数学问题(这也不是那么困难......)! 来自我们的转换矩阵 Chol=L1 L2 0 L3 作为缩放,剪切和旋转的枚举Chol=Sc*Sh*Rot with Sc=Sx 0 , Sh=1 m , Rot= cos(alpha) sin(alpha) 0 Sy 0 1 -sin(alpha) cos(alpha) 与alpha=0如下: L1=Sx , L2=m*Sx , L3=Sy , m=L1/L2. 要使用 ...
  • 如果您仅定位ipad或您的deployment device是ipad那么您的应用必须支持具有适当用户体验的every ipad 。 根据您的屏幕截图,您的图像未设置为全屏,这是autolayout简单问题。 只需从superview设置四个约束,如top,bottom,leading and trailing ,常量为0 。 而已!! If you targetting ipad only or your deployment device is ipad then your app must suppo ...
  • 这与你明显使用的字体大小有关,在这个网站上我使用以下css: html, body { font-size: 100%; /* equivalent to 16px */ } 对于影响移动字体的样式表我只为了人们的视力而放置大于16px的尺寸,例如 h2 { font-size:1.5rem; /* notice the use of rem as compared to em - I don't use px for font sizes so I don't know about ...
  • 假设您的回归是y = W*x + b其中x是缩放数据,原始数据是 y = W/std * x0 + b - u/std * W 其中u和std是平均值和x0标准差。 但我认为你不需要改造数据。 只需使用相同的u和std来缩放新的测试数据。 Suppose your regression is y = W*x + b with x the scaled data, with the original data it is y = W/std * x0 + b - u/std * W where u and ...
  • 而不是使用scipy.misc.imread (这只是Pillow的一个[弃用的]前端),请直接使用Pillow。 将索引的Image对象赋予np.array() ,会创建索引数组。 In [101]: from PIL import Image In [102]: img = Image.open('WWpd3.png') In [103]: a = np.array(img) In [104]: a.shape, a.dtype Out[104]: ((160, 320), dtype('uint ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。