APP下载

ADO.NET中数据访问方式的探讨

2017-03-27林佳一

电脑知识与技术 2017年3期

林佳一

摘要:在.NET的数据库应用程序开发中,如何选择合适的数据访问方式成为关键问题。首先介绍了.NET技术和ADO.NET的两种数据访问方式,然后从资源利用率、执行方式和使用场景三个方面,详细探讨了两种访问方式下对系统的性能消耗以及执行效率的影响,最后通过一个的具体实例对两种访问方法的应用效果进行比较,并给出了合理选择数据访问方式的建议,这对开发数据库应用系统具有实际参考意义。

关键词:ADO.NET; 连接方式的数据访问; 断开方式的数据访问;DataReader;DataSet

中图分类号:TP311 文献标识码:A 文章编号:1009-3044(2017)03-0013-03

A Discussion on Data Access Mode in ADO.NET

LIN Jia-yi

(Guangdong Communication Polytechnic,Guangzhou 510650,China)

Abstract: In development of .NET database application, how to choose the right data access mode becomes the key problem. This paper firstly introduces.NET technology and two kinds of ADO.NET data access, and then from the three aspects of resource utilization, implementation and usage scenarios, the impact on the performance of system and the execution efficiency in two kinds of access mode is discussed in detail, compared the application effect of a specific example of two access methods, and finally gives a reasonable choice of data access proposal, which has practical reference significance to the development of database application system.

Key words: ADO.NET; connected data access;disconnected data access; DataReader;DataSet

随着互联网+时代的到来,各行各业正经历着前所未有的管理模式的改变。无论单位规模大小,数据的存储、查询、统计和修改等操作是单位的日常工作中一个重要部分。为了满足目前网络环境下提出的对海量数据处理的新任务,开发应用系统时,软件开发者始终需要将如何加快数据处理的速度和提高数据的利用率放在首要位置。

数据库应用系统的开发作为软件开发的一个主要的分支,已经广泛应用到社会各个领域。大型的数据库应用系统一般采用C/S或B/S架构[1],当前两大主流开发语言系JAVA和.NET都可以在这两种架构上开发系统。.NET作为微软推出的面向Internet的新一代应用程序平台,其中涉及数据库访问的最关键技术是ADO.NET。比起以前的数据库访问技术,ADO.NET在实现程序之间的数据共享上具有优越性,它提供了连接和断开两种数据访问方式。对……

登录APP查看全文