question about datareader in function

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

i use this to recover data via a stored procedure from a database.

Imports System.Data
Imports System.Data.SqlClient
Public Class chat
Public Shared Function myfunction() As DataSet
Dim dsdata As DataSet = New DataSet()
.....
end function
end class

Now i wondered whether it would work with DataReader, but in the
Intellisense of Visual Web Dev. there is no Datareader to see.
Is it not available and if no, why?

Thanks
Chris
 
Hi,

i use this to recover data via a stored procedure from a database.

Imports System.Data
Imports System.Data.SqlClient
Public Class chat
Public Shared Function myfunction() As DataSet
Dim dsdata As DataSet = New DataSet()
....
end function
end class

Now i wondered whether it would work with DataReader, but in the
Intellisense of Visual Web Dev. there is no Datareader to see.
Is it not available and if no, why?

Thanks
Chris

Chris,
Try using SqlDataReader, not just DataReader
 
Indeed ... thanks
why sqldatareader and not sqldataset ??

"Charlie Brown" <[email protected]> schreef in bericht




- Show quoted text -

Dataset belongs to System.Data and SqlDataReader belongs to
System.Data.SqlClient, since the DataSet is used independant of any
datasource.

The DataReader is optimized for SQL Server, so it is placed in
SQLClient, likewise their is also a OleDbDataReader,
OracleClientDataReader, etc...
 
Ok, thanks

Charlie Brown said:
Dataset belongs to System.Data and SqlDataReader belongs to
System.Data.SqlClient, since the DataSet is used independant of any
datasource.

The DataReader is optimized for SQL Server, so it is placed in
SQLClient, likewise their is also a OleDbDataReader,
OracleClientDataReader, etc...
 
Back
Top