Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
var prpty = from pm in rdc.tbl_PropertyMasters
join pt in rdc.tbl_PropertyTypes on pm.PropertyTypeId equals pt.PropertyTypeId
join loc in rdc.tbl_Locations on pm.LocationId equals loc.LocationId
join city in rdc.tbl_Cities on pm.CityId equals city.CityId
select new
{
    pt.PropertyType,
    loc.LocationName,
    city.CityName,
}
Posted
Updated 26-Apr-11 1:10am
v3
Comments
LittleYellowBird 26-Apr-11 6:49am    
Hi, I think you need to improve your question. Explain exactly what you are having trouble with, what data is repeated? What do you mean by uniques data? Also, put your code in a 'code block'. That way you will get more helpfull replies and more quickly. Just a suggestion. Ali :)

As i think it would work. Just use Distinct().

var prpty = (from pm in rdc.tbl_PropertyMasters
                                    join pt in rdc.tbl_PropertyTypes on pm.PropertyTypeId equals                                    pt.PropertyTypeId
                                    join loc in rdc.tbl_Locations on pm.LocationId equals loc.LocationId
                                    join city in rdc.tbl_Cities on pm.CityId equals city.CityId
                                    select new
                                    {
                                          pt.PropertyType,
                                          loc.LocationName,
                                          city.CityName,
                                    }).Distinct(); 
 
Share this answer
 
Comments
Vineet_2109 26-Apr-11 7:11am    
Thanks it worked...
nit_singh 26-Apr-11 7:21am    
your welcome...:)
If you mean you don't want duplicate rows of data in your result set, you probably need to add 'distinct' or '.Distinct()'.
 
Share this answer
 
Hi Vineet_2109,

Be sure that the 3 selected items will be the same and use the answer of nit_singh

Good luck,
:)
 
Share this answer
 
also, alternate solution:


List<list><string>> Records = GetRecords();
//
List<list><string> UniqueRecords = Records
  .GroupBy(r => r[0])
  .Where(g => !g.Skip(1).Any())
  .Select(g => g.Single())
  .ToList();
</string></list></string></list>
 
Share this answer
 

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