linq to sql - Can't load a DropDownList with values -


I am following the NerdDinner tutorial when creating my own application.

Tutorials:

  Edit Public Functionality (Ent ID) {Dinner Dinner = Dinner Reptile. Gate dinner (ID); See data ["country"] = new selection list (Phone Validate. All countries, dinner parties); See refresh (dinner); }  

My code is like this:

  edit public functioning (int id) {area area = area area JefeRepository jefe = new JefeRepository (); SeeData ["Jefes"] = new selection list (jefe.FindAllJefes (), field. Jefe.Nombre); Return view (area); }  

FindAllJefes () returns an IQueryable collection just when I load the dropdown with two items in the app: SeguimientoDocente.Jefe and SeguimientoDocente.Jefe.

It seems that this type is loading and does not want the actual value.

Thanks for the help!

Edit: I realized that this is not a bug, this code is doing what I am saying properly. What would be the most effective way to retrieve Jeff's name?

Use another constructor for selective You specify which property of SeguimientoDocente should be a value And the property which should be displayed as text. Here's something:

  View Data ["Jeffs"] = New Selection List (Jeff.Fundelves (), "id", "name", field.jf number);  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -