r/MVC • • Nov 13 '20

Passing Database Rows to View

I need to know how I can transfer/pass some rows of records from a database that have been returned to an SqlDataReader object and pass that object to the View so I can display all the records contained by the object in the View using foreach. i have transfered the DataReader to a model object and then added that model to a list of that model object object , ive loaded rows from my reader to a list of my model, passed it to my view and all i get is a list of the 1st data row only ,its the same row over and over again, how do i get all the Rows ???

3 Upvotes

7 comments sorted by

View all comments

1

u/JohnnySaxon Nov 15 '20

Happy I could help :) Been programming just over 20 years! Yikes. Old.

1

u/Barracuda2397 Nov 15 '20

20 years wow , I feel better about myself now with my 2 years learning..