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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:15:56+00:00 2026-05-23T05:15:56+00:00

I created two tables(FIRSTtable and SECONDtable) in the mysql database and two tables that

  • 0

I created two tables(FIRSTtable and SECONDtable) in the mysql database and two tables that are related.

The FIRST table, has a columns (product_id (pK), product_name).
The SECOND table has an columns (machine_id, production_date, product_id (fK),
product_quantity, operator_id).

Relations between the two tables using the product_id column with UpdateCascade and DeleteCascade. Both relationships are functioning normally when I try with the sql script. Suppose I delete all product_id in the FIRST table, all existing data in the SECOND table will be deleted.

Both of these tables displayed in datagridview. When I delete all the data in the FIRST table, the all rows in datagridview FIRST table will be deleted, also the data in mysql the FIRST table will be deleted.

I try to open the mysql database, the data are in SECOND Table also deleted, the problem why the view that in the second datagridview, can not be deleted, still keep the previous data? How to refresh datagridview binding in vb.net or C#? Thanks.

    With Me.SECOND_DataGridView
        .Datasource = Nothing  ' tried this, but failed.
        .DataSource = MyDataset.Tables("SECOND_table")
    End With
  • 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-23T05:15:57+00:00Added an answer on May 23, 2026 at 5:15 am

    I believe what you are running into is the fact the the MySQL Engine is actually performing the cascading deletes for you.

    When you query the MySQL Data into a localized C# “DataTable” (Table within a DataSet), that data is now in memory and not directly linked to that on the disk. When you go to delete the rows in the “memory” version of the first data table, its causing the deletions to occur at the SERVER for the second level table and NOT directly updating you in-memory version of data table two.

    That being said, you will probably have to do one of two things… Requery the entire dataset (tables one and two) to get a full refresh of what is STILL in the actual database… OR… As you are calling the delete from table one of the dataset, you’ll have to perform the delete handling in the local datatable TWO as well to keep it in synch.

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

Sidebar

Related Questions

First.. here are the two tables I've created (sans irrelevant columns).. CREATE TABLE users_history1
I created a MySQL view using UNION ALL from two tables so that I
we have two related tables(inventory and inventoryLocalization) on Sql Server 2005. the first table's
I have a script in MySQL that creates two tables, the second table references
I have two SQL Server tables. One table has four nvarchar(50) nullable columns and
I have created two tables in MySQL which are called birthTable and deathTable. When
i have two tables, tasks and actions. actions has two columns, created_at and updated_at.
I have a view that is joining two tables and ordering by the first
I have created two tables ORDERS and ORDERITEMS with the following constraint: alter table
From the regular aspnet_Users table I have created two sub-tables with one to one

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.