I am trying to migrate asp.net 3.5 application to asp.net 4.0 version.
asp.net 3.5 is working without any issues, after migrating to asp.net 4.0 getting the below error
"An invalid data source is being used for rptStudents. A valid data source must implement either IListSource or IEnumerable."
Note: Migrated to Enterprise library 5.0 from 4.1
Code:
Using drStudents As IDataReader = dbStudents.ExecuteReader(cmdStudents)
With rptStudents
.DataSource = drStudents
.DataBind()
End With
End Using
Davide:Thanks for your quick response.
drStudents is a IDataReader and this code is working good
Dim dbStudents As Database = DatabaseFactory.CreateDatabase("eCONNECTION") Dim cmdStudents As DbCommand = dbComments.GetStoredProcCommand("get_students")
Using drStudents As IDataReader = dbStudents.ExecuteReader(cmdStudents) With rptStudents .DataSource = drStudents .DataBind() End With End Using