Dataset problem...

  • Thread starter Thread starter newbie
  • Start date Start date
N

newbie

Hi all,

I've 2 tables in a DataSet.
The first table is "ARTICLE"
The second is called "SELECTION"
The column "ART_CODE" is the primary key for the two tables

Problem :
I want to get the articles which aren't in SELECTION

What I do :
...
string where =
" ( ART_CODE not in ( select ART_CODE in SELECTION ) )";

// m_ds is a DataSet
DataTable dt = this.m_ds.Tables[ "ARTICLE" ];
DataRow[] drs = dt.Select( where, "ART_CODE" );

this.lvDisponible.Items.Clear();

foreach( DataRow dr in drs )
{
ListViewItem lvi =
new ListViewItem(
new string[]
{
dr[ "ART_CODE" ].ToString(),
dr[ "ART_LABEL" ].ToString()
} );
lvDisponible.Items.Add( lvi );
}

Error :
ADO.net doesn't recognize the word 'ART_CODE'
I get this message: "opérande manquant après l'opérateur 'ART_CODE'."
It's in French, sorry :-(
And sorry too for my poor english :-(

Notes:
- The code works fine if I don't have the condition "where"


Do you have a solution ? Is it possible to do something like a "NOT IN" with
a DataSet ?

Thank you very much in advance !!!

Laura
 
Hi newbie,

"select" keyword won't work within filter statament (see
DataColumn.Expressions .net help topic of possible combinations).
You'll have to put in all key values that you don't want to see....
 
Back
Top