Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 546363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:51:33+00:00 2026-05-13T10:51:33+00:00

I’m developing a POS system and I need to check whether the database tables

  • 0

I’m developing a POS system and I need to check whether the database tables on each terminal are out of sync.

I maintain a Dictionary of terminal information, each of which has Dictionary containing table ids with a CRC for each table. Below is simplified description of what I’ve got so far (i’m using VB.NET but I’ve stripped out a lot of stuff to hopefully clarify things):

e.g.   TerminalList = Dictionary(Of Integer, TerminalInfo)

       class TerminalInfo
         TerminalID: Integer
         TableCRCs: Dictionary(Of String, TableInfo)

       class TableInfo
         TableID: String
         CRC: UInt32


       TerminalID: 1
          TableID: A   CRC: aa10
          TableID: B   CRC: 1234

       TerminalID: 2
          TableID: A   CRC: aa10
          TableID: B   CRC: 1234

       TerminalID: 3
          TableID: A   CRC: 12be
          TableID: B   CRC: 1234

Is it possible for me to create a LINQ query that will build a list of distinct TableIDs and CRC’s?

i.e. A  aa10
     A  12be
     B  1234

If the count of this query is greater than the number of tables that i’m interested in then I know that a terminal is out of sync. I’m not interested in which terminal or which table is out of sync, only that there is a difference.

TIA,

Simon

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:51:33+00:00Added an answer on May 13, 2026 at 10:51 am

    Sure. You didn’t specify a language so I hope that C# is okay (I’m not fluent in VB.NET but I can help you if you need help translating):

    var query = TerminalList.SelectMany(kvp => kvp.Value.TableCRCs.Values)
                            .GroupBy(info => new { info.TableID, info.CRC });
    
    foreach (var result in query) {
        Console.WriteLine(
            String.Format(
                "{0}|{1:x}",
                result.Key.TableID,
                result.Key.CRC
            )
        );
    }
    

    The key to this is using SelectMany to flatten the nested enumerations of TerminalInfos into one enumeration. From there it’s just a usual GroupBy operation to get the desired result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 309k
  • Answers 309k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer From where are you sending the data? Other window? From… May 13, 2026 at 10:01 pm
  • Editorial Team
    Editorial Team added an answer Why don't check the API docs? The answer is right… May 13, 2026 at 10:01 pm
  • Editorial Team
    Editorial Team added an answer Your second RewriteCond only checks whether the hostname begins with… May 13, 2026 at 10:01 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.