Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

I need help with complex LINQ to XML query in C#  RSS feed

Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don’t know if the query I am trying to do is even possible but if one of you LINQ to SQL/XML guru’s can figure this out I will be so thankful and salute you as a LINQ God. My end goal is to identify all of the XML Models that are duplicates and show the CECID for all the duplicates except one. So lets say I have an Xdocument that looks like this:

Then in SQL Server I have a table called tApplianceTypeColumns that looks like this for a given appliance type:


So here is what I started with but I am far from being close:

So really I want to be able to group by Brand, Model Number, and RegulatoryStatus which are the columns in the tApplianceTypeColumns table that have the ApplianceColumnUnique bit column set to true. The number of true bits could vary depending on the ApplianceTypeID I am looking up in that table. Additionally, I also need to include two elements in the grouping that are never in the tApplianceTypeColumns table and those elements are Action then ManufacturerCode followed by all the other unique elements from the tApplianceTypeColumns in no specific order. So ApplianceTypeID is a known parameter that will be passed to the query. So for any set of duplicates I need to display the CECID for the 2nd and subsequent duplicates so that I can take those CECID’s and do lookups in other tables to change their status. But this first step is tough. I don’t care which of the duplicates does not get displayed. I just need to display all others except 1. I hope I have explained this well enough.

UPDATE: I was able to get a solution for this on Here is a link to the solution.
StackOverflow Solution

Normally trees don't drive trucks. Does this tiny ad have a license?
Create Edit Print & Convert PDF Using Free API with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!