none
How to select columns in table? RRS feed

  • Question

  • I have table "Persons"  in SQL database with 10 columns. I only want to select 3 columns in the list, how to do that?

    List<Persons> myPersons = myDataBase.Persons.ToList(); //This loads all columns but I need to load columns "name", "lastName" and "Age" for example.

    I think the Select() method is the answer but I do not know the syntax...
    Thursday, January 28, 2010 12:19 PM

Answers