IDataReader与示例的用法是什么 [英] What is the use of IDataReader with example

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

问题描述

我是c#的新手,在读书时发现了一个新的接口IDataReader.我不理解该接口的用法.任何人都可以对此接口进行解释.谢谢预先.

I am new to c# .I found a new interface IDataReader while reading in a book.I didnt understood use of that interface.Can any one explain about this interface.Thanks In Advance.

推荐答案

您通常不会使用它-它是由各种DataReaders实现的接口-SqlDataReader,MySqlDataReader等访问数据库数据.
如果您是C#的新手,那么我现在就忽略它-我从未使用过它,而且我不是初学者!
You wouldn''t normally use it - it is the interface which is implemented by the various DataReaders - SqlDataReader, MySqlDataReader, and so on which access database data.

If you are new to C#, then I would just ignore it at present - I have never used it, and I''m not a beginner!


根据msdn提供一种读取通过在数据源执行命令而获得的一个或多个结果集的仅前向流,并由访问关系数据库的.NET Framework数据提供程序实现."

此接口提供一些常用的属性/方法,然后在该接口的各种数据库特定实现中使用.

例如SQLDataReader [
As per msdn "Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET Framework data providers that access relational databases."

This interface provides some common properties / methods that are then used in various database specific implementations of this interface.

For e.g. the SQLDataReader[^] provides an implementation specific to SQL Server.

A few data readers are listed below. You can refer MSDN for details on any of these -
System.Data.DataTableReader
System.Data.EntityClient.EntityDataReader
System.Data.Odbc.OdbcDataReader
System.Data.OleDb.OleDbDataReader
System.Data.OracleClient.OracleDataReader
System.Data.SqlClient.SqlDataReader


这篇关于IDataReader与示例的用法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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