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

I am getting the Values from DataBase View Table using the EDM Query as
XML
IList<EFModel.EntityModel.vwGetActiveEmployee> Type.


it is giving some Collection of Elements. From this collection, i am tring to filter the data based on One Column but is doesn't giving the filtered data even though the data is present based on condition

The Query is as like below.

For Getting Data form DataBase

// it is fetching some collection of data.

XML
IList<EFModel.EntityModel.vwGetActiveEmployee> activeEmployeelist = TimeOffService.GetActiveEmployees();


Here i want to fileter the data based on Column IsManger(values 1 or 0)
For that i wrote like

XML
IList<EFModel.EntityModel.vwGetActiveEmployee> managerlist = activeEmployeelist.Where(p => p.IsManager == 1).Select(p => p) as IList<EFModel.EntityModel.vwGetActiveEmployee>;



But here the Managerlist showing null values.
When i filter the data using below

C#
var emplistVar = activeEmployeelist.Where(p => p.IsManager.Equals(1)).Select(p => p);

it showing the some collection of data with "var" type but if i give Class type it showing null.

What is the reason here, This data is taken from database View Data.


Thank you.

[edit]unnecessary Code blocks removed[/edit]
Posted
Updated 24-Jun-13 5:04am
v3
Comments
saguptamca 19-Jul-13 4:28am    
can u show some sample records u have and their datatype also
V G S Naidu A 19-Jul-13 5:25am    
the above code it self is what i wrote.

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