G
Guest
in the 'Access Cookbook' by Getz, Litwin and Baron, it shows how to get a
qryAlternativeAlbums query as an OleDbDataReader:
'Construct an OleDbCommand to execute the query
Dim AltRock as OleDbCommand = _
New OleDbCommand("qryAlternativeAlbums", cnx)
'Odd as it may seem, you need to set the CommandType
'to CommandType.StoredProcedure.
cmdAltRock.CommandType = CommandType.StoredProcedure
'Run the query and place the rows in an OledbDataReader.
Dim drAltRock as OleDbDataReader
drAltRock = cmdAltRock.ExecuteReader
'Bind the OleDbDataReader to the DataGrid
dgrAltRock.DataSource = drAltRock
dgrAltRock.DataBind()
As an Access developer, this was exciting news, as I thought I presently had
no way to use joins to Union queries, etc...
Anyhow, I was wondering if I can use the DataAdapter in the same fashion?
Please help me get any kinks out if this is possible.
And if not, how can I parameterize a DataReader - is this possible?
qryAlternativeAlbums query as an OleDbDataReader:
'Construct an OleDbCommand to execute the query
Dim AltRock as OleDbCommand = _
New OleDbCommand("qryAlternativeAlbums", cnx)
'Odd as it may seem, you need to set the CommandType
'to CommandType.StoredProcedure.
cmdAltRock.CommandType = CommandType.StoredProcedure
'Run the query and place the rows in an OledbDataReader.
Dim drAltRock as OleDbDataReader
drAltRock = cmdAltRock.ExecuteReader
'Bind the OleDbDataReader to the DataGrid
dgrAltRock.DataSource = drAltRock
dgrAltRock.DataBind()
As an Access developer, this was exciting news, as I thought I presently had
no way to use joins to Union queries, etc...
Anyhow, I was wondering if I can use the DataAdapter in the same fashion?
Please help me get any kinks out if this is possible.
And if not, how can I parameterize a DataReader - is this possible?