R
rn5a
The following code calls a function in a DLL which returns a
SqlDataReader (the function in the DLL calls a stored procedure which
returns 6 columns):
Dim boCart As Cart
Dim sqlReader As SqlDataReader
boCart = New Cart
boCart.GetRecords(iUserID)
'Next I want to just display the record in the last column (whose
ordinal no=5) corresponding to the UserID
While (sqlReader.Read)
Response.Write(sqlReader.GetValue(5))
End While
The above does display the appropriate record. Next I want to display
the rest of the records in a DataList but when I do
dlCart.DataSource = sqlReader
dlCart.DataBind()
the DataList doesn't display the records. How do I populate the
DataList with the rest of the records that the stored procedure
retrieves?
SqlDataReader (the function in the DLL calls a stored procedure which
returns 6 columns):
Dim boCart As Cart
Dim sqlReader As SqlDataReader
boCart = New Cart
boCart.GetRecords(iUserID)
'Next I want to just display the record in the last column (whose
ordinal no=5) corresponding to the UserID
While (sqlReader.Read)
Response.Write(sqlReader.GetValue(5))
End While
The above does display the appropriate record. Next I want to display
the rest of the records in a DataList but when I do
dlCart.DataSource = sqlReader
dlCart.DataBind()
the DataList doesn't display the records. How do I populate the
DataList with the rest of the records that the stored procedure
retrieves?