【VB.NET】ADO.Net学习(二)DataReader填充DataTable
Imports System
Imports System.Data
Imports System.Data.Common
Namespace DataUtils
Public Class DataReaderAdapter
Inherits DbDataAdapter
Public Function FillFromReader(ByRef dataTable As DataTable, ByVal dataReader As IDataReader) As Integer
Return Me.Fill(dataTable, dataReader)
End Function
Protected Overloads Overrides Function CreateRowUpdatedEvent(ByVal dataRow As DataRow, ByVal command As IDbCommand, ByVal statementType As StatementType, ByVal tableMapping As DataTableMapping) As RowUpdatedEventArgs
Return Nothing
End Function
Protected Overloads Overrides Function CreateRowUpdatingEvent(ByVal dataRow As DataRow, ByVal command As IDbCommand, ByVal statementType As StatementType, ByVal tableMapping As DataTableMapping) As RowUpdatingEventArgs
Return Nothing
End Function
Protected Overloads Overrides Sub OnRowUpdated(ByVal value As RowUpdatedEventArgs)
End Sub
Protected Overloads Overrides Sub OnRowUpdating(ByVal value As RowUpdatingEventArgs)
End Sub
End Class
End Namespace
IDataReader 接口 Imports System.Data
Imports System.Data.Common
Namespace DataUtils
Public Class DataReaderAdapter
Inherits DbDataAdapter
Public Function FillFromReader(ByRef dataTable As DataTable, ByVal dataReader As IDataReader) As Integer
Return Me.Fill(dataTable, dataReader)
End Function
Protected Overloads Overrides Function CreateRowUpdatedEvent(ByVal dataRow As DataRow, ByVal command As IDbCommand, ByVal statementType As StatementType, ByVal tableMapping As DataTableMapping) As RowUpdatedEventArgs
Return Nothing
End Function
Protected Overloads Overrides Function CreateRowUpdatingEvent(ByVal dataRow As DataRow, ByVal command As IDbCommand, ByVal statementType As StatementType, ByVal tableMapping As DataTableMapping) As RowUpdatingEventArgs
Return Nothing
End Function
Protected Overloads Overrides Sub OnRowUpdated(ByVal value As RowUpdatedEventArgs)
End Sub
Protected Overloads Overrides Sub OnRowUpdating(ByVal value As RowUpdatingEventArgs)
End Sub
End Class
End Namespace
提供一种方法来读取一个或多个通过在数据源执行命令所获得的只进结果集流,这是由访问关系数据库的 .NET Framework 数据提供程序实现的。
![]() | 本作品采用 知识共享署名-非商业性使用 2.5 中国大陆许可协议进行许可。 |