Display rows from one table not in another in a dataset

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

I have a dataset with 2 tables. I want to display in a datagrid the
rows in table 1, that are not in table 2. I'm trying the rowfilter on
a dataview, but I'm getting an error. The error I'm getting is:
Syntax error: Missing operand after 'ID' operator.

Here is what I'm doing...
dvInWindows = Me.g_dsCodes.Tables("Table1").DefaultView
dvInWindows.RowFilter = "ID1 not in (select ID2 from Table2)"

What is the correct syntax for this?

Thanks...
 
Sam,

So extended is AFAIK the Select in the dataview not going.

An option the relation is something you cannot use because that expects that
there is always parent child relation.

If it was my problem, then I would create an extra datatable using an SQL
statement with a join in it, that is probably for most the easiest.

Without that you can create an extra table with looping through your table
or by creating an extra column in your dt and fill that while looping with
the id of table 2 and then use that as filter.

Cor
 
Back
Top