bmanmike39
asked on
How do you select specific field from an entity like fNam lName and so on using entity?
I would like to select just specific fields in the db and create a list. I want the select statement to return all the records that have the InvoiceNumber of 1020.
and the only records in the field i want are fName, lName, and Email. This bind it to a dategrid.
How would I write this with entity.
and the only records in the field i want are fName, lName, and Email. This bind it to a dategrid.
How would I write this with entity.
MyEntities1 m = new MyEMEntities1();
int v = 1020;
GridView1.DataSource = m.Invoice.fName,lName,Email(x => x.InvoiceNumber == v).ToList();
GridView1.DataBind();
ASKER
I get a error == can't be applied to type operand type 'sting' and 'int'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks!!
Not a problem bmanmike39, glad I was able to help.
Try this, it should give you what you are looking for.
Open in new window