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 514119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:29:30+00:00 2026-05-13T07:29:30+00:00

With SubSonic 3 / ActiveRecord, is there an easy way to compare two records

  • 0

With SubSonic 3 / ActiveRecord, is there an easy way to compare two records without having to compare each column by column. For example, I’d like a function that does something like this (without having to write a custom comparer for each table in my database):

public partial class MyTable
{
    public IList<SubSonic.Schema.IColumn> Compare(MyTable m)
    {
        IList<SubSonic.Schema.IColumn> columnsThatDontMatch = new...;
        if (this.Field1 != m.Field1)
        {
            columnsThatDontMatch.add(Field1_Column);
        }
        if (this.Field2 != m.Field2)
        {
            columnsThatDontMatch.add(Field2_Column);
        }
        ...
        return columnsThatDontMatch;
    }
}

In the end, what I really need is a function that tests for equality between two rows, excluding the primary key columns. The pseudo-code above is a more general form of this. I believe that once I get the columns that don’t match, I’ll be able to check if any of the columns are primary key fields.

I’ve looked through Columns property without finding anything that I can use. Ideally, the solution would be something I can toss in the t4 file and generate for all my tables in the database.

  • 1 1 Answer
  • 0 Views
  • 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-13T07:29:30+00:00Added an answer on May 13, 2026 at 7:29 am

    The best way, if using SQL Server as your backend as this can be auto populated, is to create a derived column that has a definition that uses CHECKSUM to hash the values of “selected” columns to form a uniqueness outside of the primary key.

    EDIT: if you are not using SQL Server then this hashing will need to be done in code as you save, edit the row.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The get_browser() function has been available in PHP for quite… May 13, 2026 at 1:28 pm
  • Editorial Team
    Editorial Team added an answer I think the format string should be (?1$1:000) as described… May 13, 2026 at 1:28 pm
  • Editorial Team
    Editorial Team added an answer SELECT O.sku, O.qty, PP.price FROM Orders O INNER JOIN Purchase_Prices… May 13, 2026 at 1:28 pm

Related Questions

If I have a method that does something with multiple Subsonic ActiveRecords and doesn
In WPF and SubSonic 2 using Active Record, I was able to bind to
I'm starting an ASP.NET MVC project using SubSonic 3 ActiveRecord. I added a table
I'm fairly new to SubSonic, and downloaded the latest version which only contained a
I've started a C# web application project using subsonic 3.0.3 as my DAL and

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.