Z
Zoltan Hubai
Hi
I would like to select rows from one table according the rows from
another table in .net with C#. Both tables are loaded into memory.
For example a simple structure
CustomerGroup Customer
------------- --------
groupID customerID
name name
customerID (FK)
employee (FK)
Now according wich employee is loged in his customer groups are filtered
and after he selects the group i would like to filter the rows in the
customer table.
Somthing like:
DataRow[] rows =
CustomerGroup.Select("groupID=\""+employee_Selected_Group+"\"");
Customer.Select("customerID in rows.customerID").
Only to get an idea what I intend to do, no casting etc. in example.
Not sure if this is possible.
I could do the same with SQL but then when the employee changes the
group I would need to refetch again the records. In SQL then following
should be like:
SELECT * FROM Customer WHERE Customer.customerID IN (SELECT
CustomerGroup.customerID FROM CustomerGroup WHERE
CustomerGroup.groupID=:GROUPID)
Thx, and sorry for my poor english
I would like to select rows from one table according the rows from
another table in .net with C#. Both tables are loaded into memory.
For example a simple structure
CustomerGroup Customer
------------- --------
groupID customerID
name name
customerID (FK)
employee (FK)
Now according wich employee is loged in his customer groups are filtered
and after he selects the group i would like to filter the rows in the
customer table.
Somthing like:
DataRow[] rows =
CustomerGroup.Select("groupID=\""+employee_Selected_Group+"\"");
Customer.Select("customerID in rows.customerID").
Only to get an idea what I intend to do, no casting etc. in example.
Not sure if this is possible.
I could do the same with SQL but then when the employee changes the
group I would need to refetch again the records. In SQL then following
should be like:
SELECT * FROM Customer WHERE Customer.customerID IN (SELECT
CustomerGroup.customerID FROM CustomerGroup WHERE
CustomerGroup.groupID=:GROUPID)
Thx, and sorry for my poor english