question about datareader in function

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
 
C

Charlie Brown

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
 
C

Charlie Brown

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...
 
C

Chris

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top