Click here to Skip to main content
15,897,226 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I had a Observable Collection(fields like username,firstname,lastname,password,address,contact no etc) which contains a huge set of rows, and also i am having a datatable(columns like SNo, username,status) which is having a limited number of rows only. Now what i want is, I need to filter the observable collection based on the usernames present in the datatable in the datatable and bind the observable collection to datagrid using linq. I done a sample linq Query it does not produce exact data.
var res = from a in Settings.GetInstance().ObservableClass where dtStatusTable.Rows.Contains(a.UserName)select a;

Settings.GetInstance().ObservableClass = res as ObservableCollection<IObservableClass >;

The result observable collection should contain only the data which username is present in the datatable and observable collection are exactly same.

Note: UserName is unique and may be contains similar but not exact. Like usernames may be like Manikandan, Mani, ManikandanSekar etc. Kindly give me a solution to filter the data.
Posted
Updated 28-Oct-13 5:47am
v2

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