-2

This is my scenario the DataSource from my DataGridView is not linked to a open database, so I am not going to use a DataAdapter.

In order to avoid the need to have a constant database connection (to save resources), a user is only able to save changes (i.e., update the database), only when cells/rows are deleted/modified from the DataGridView.

My problem comes in here. I have a database with two DataGridView objects, resembling a master/detail relationship. The second DataGridView has an extra filter that is applied when the user clicks on the master table row, from which all records relating to that specific row will be reflected in the child DataGridView (second DataGridView).

I have three DataSets:

  • one for the master table,
  • one for the detail table, and
  • one for the filtered rows from the second table

The filter is a simple SELECT statement:

DataSet.Tables[TableName].Select(...);

When deleting rows from the second DataGridView (linked to the third DataSet), I want that specific row from the third DataSet to delete the second DataSet.

But I don't know how to link a DataSet to other DataSet objects.

Or is there another alternative here?

Gustavo Mori
  • 8,319
  • 3
  • 38
  • 52
SpaceApple
  • 1,309
  • 1
  • 24
  • 46

1 Answers1

0

Use DataTable and follow example here: Inner join of DataTables in C# to join two or more datatables by using LINQ

Community
  • 1
  • 1
antar
  • 510
  • 1
  • 3
  • 16