Hi All I am so confused by this thing. One type of list work... a list with a find or where statement creates an error. No really understanding why. This is the mvc below is the source codes... maybe some one can help.
What it is that I am trying to do. I am simply making a from that allows me to enter a code that will be used to query the database so that I can down load the fille stored in the database.
Seems like the MVC,,, he does not like dealing with the list
THis is the view
THis is the controller and the function that fails is gate
The Error Page he makes
What is odd is if I put this in the controller the view works fine
DSDBEntities DB_Entities = new DSDBEntities(); return View(DB_Entities.DSDB_STORE_TBL.ToList());
The view has this
@model IEnumerable<DSDB_V1.Models.DSDB_STORE_TBL>
For some reason this works. But I I try to filter the list he says that I can because:
The model item passed into the dictionary is of type 'DSDB_V1.Models.DSDB_STORE_TBL', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[DSDB_V1.Models.DSDB_STORE_TBL]'.
This does not make since to be how one list work and a list that has been filtered will not work, thank makes no sense to me and makes this very confusing.
No some will say its because he is not enumerated... I will have to be honest. I do not know what that really means in computer regards. WHen I research the defeminations it does not make sense what he trying to say.
Why does this not work as a list that can display in the view:
DSDBEntities DB_Entities = new DSDBEntities();
return View(DB_Entities.DSDB_STORE_TBL.ToList().Find(d => d.DOC_SOURCE_DISC == "WRITE"));
Why does this work in the view
DSDBEntities DB_Entities = new DSDBEntities();
return View(DB_Entities.DSDB_STORE_TBL.ToList());
I need to filter this list from the screen with input via the description filed but I don't to return everything because there will be items from many different sources. Here is the user interface working the wrong way.
The right way will be the user see this screen first
They type the code
As see the list from the database. That word WRITE filters the description from the database field.
Can someone help and tell me why is he so wrong??? Thank you so much in advance.
Sorry it would not let put code for some reason