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

  • SEARCH
  • Home
  • 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 7078643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:34:23+00:00 2026-05-28T06:34:23+00:00

I have a Table, called Table1, with 3 columns: 1) id – An integer

  • 0

I have a Table, called Table1, with 3 columns:

1) id – An integer and the primary key

2) Name – A string

3) Flagged – A boolean

In most cases any rows of Table1 will be have Flagged set to false. I’m interested in knowing when any row has a value set to true. For now, I’ve simply been using the query

Table1.Select(“Flagged = TRUE”)

However, I thought it may be possible to determine this using events.

The code below with the DataColumnChangeEventHandler will give me a notification for any column changes. The Notification_ColumnChanged() method gets called three times since there are three lines in the method UpdateTable().

I would prefer to only get a notification once and only if any rows in the Flagged column are modified and therefore I don’t need to call a Select() method. I was wondering if this is possible? Perhaps DataViews and events based on those would be a better way to achieve this? I’m interested in any suggestions.

Thanks.

using System;
using System.Data;

namespace ConsoleApplication1
{
    public class Program
    {
        private TestDataSet _testDataSet;

        public Program()
        {
            _testDataSet = new TestDataSet();
            _testDataSet.Table1.AddTable1Row(1, "name1", false);
            _testDataSet.Table1.AddTable1Row(2, "name2", false);
            _testDataSet.Table1.AcceptChanges();
            _testDataSet.Table1.ColumnChanged += new DataColumnChangeEventHandler(Notification_ColumnChanged);
        }

        private void Notification_ColumnChanged(object sender, DataColumnChangeEventArgs e)
        {
            Console.WriteLine("Notification_ColumnChanged");
        }

        public void UpdateTable()
        {
            Console.WriteLine("Updating");
            _testDataSet.Table1[0].Flagged = true;
            _testDataSet.Table1[1].Flagged = true;
            _testDataSet.Table1[1].Name = "name2";
        }

        public static void Main(string[] args)
        {
            Program p = new Program();
            p.UpdateTable();
        }
    }
}
  • 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-28T06:34:24+00:00Added an answer on May 28, 2026 at 6:34 am

    It is not possible because the ColumnChanged event (and also RowChanged event) works on entire row. You can solve testing what column is changed into Notification_ColumnChanged, but it will be fires for any columns.

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

Sidebar

Related Questions

I have a table called Table with columns: ID (int, primary key, clustered, unique
I have a table called excel that has 3 columns, name , id ,
I have a table called categories that has 3 columns: id, name, parent_id .
lets say I have a table called table1 and it's corresponding columns are col1,
I have one DB table called table1 have some columns two of them are
I have a table called table1 with 3 columns, a, b, and c. b
I have a table called table1. It has 3 columns: id, int, auto incrementing,
I have a table called table1 with two coloumns id and name. The values
I have one table called Mydata with date,name,address columns this table is having more
I have a table called baskets with these columns: basket (name of the basket)

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.