Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am iterating though linq using foreach but it is giving error of specified cast is not valid.

C#
foreach (var items in query)
{
    custDetail = new CustDetail();
    custDetail.id = items.id;
    custDetail.age = items.age;
    custDetail.Name = items.Name;
    custDetail.address = items.address;

    dd.Add(custDetail); // generic list of CustDetail object.
}


Please help me...
Posted
Updated 21-Nov-11 22:08pm
v2
Comments
Wayne Gaylard 22-Nov-11 2:59am    
You will have to post your original query for anyone to help you. We cannot tell from your snippet what was orginally queried.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900