views:

16

answers:

1
ECommerceAdoEntities oContext = new ECommerceAdoEntities();           
var lstnames = from c in oContext.tbl_ShippingProfile  select c.Name;

When I try to run a linq query against a ADO.net entity data model data source and return more than one column (c.Name,c.ID) it gives me error in C#

But in VB I am able to do it.

Dim adoDataEntity As New ECommerceAdoEntities()
Dim lstAdoSource = From c In adoDataEntity.tbl_ShippingProfile Select c.Name, c.ID

Any idea why?

+3  A: 
 var lstnames = from c in oContext.tbl_ShippingProfile  
                select new 
                {
                   c.Name,
                   c.ID
                 };
James Curran