DataAdapter 是将数据插入 SQL Server 数据库的可靠方法吗
昨天我的同事告诉我,使用数据适配器向sql server数据库插入数据并不可靠,因为它不能保证数据正确插入。他还告诉我,如果数据插入不成功,它不会显示任何类型的错误消息。
我真的很困惑。我认为微软发明了 ado.net,以便可以将数据插入数据库而不会产生任何额外的危险。
你们觉得怎么样?数据适配器不可靠吗?
Yesterday My colleague told me that using data adapter to insert data into an sql server database is not reliable, because it does not guarantee that data are inserted properly. He also told me that if the data insertion is unsuccessful, it does not show any kind of error message.
I am really confused. I thought microsoft invented ado.net so that data can be inserted into the database without any extra hazard.
What do you guys think? Is data adapter unreliable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DataAdapter 与直接使用 SqlCommand 一样可靠(即:足够可靠)。
它可能不是最奇特的方法,但它的存在时间大约与 .NET 本身一样长,并且被很多应用程序使用。
A DataAdapter is just as reliable as using a SqlCommand directly (ie: reliable enough).
It may not be the fanciest way to do this but it has been around for about as long as .NET itself and it is used by very many applications.