Dear All ,
The question is simple , but may be It is very simple for me that I can not see it .
I have two dataset , each with with table . each datasets is connected to a separate dataadapter to get data from sql server database file (two different tables SQLtableOrders & SQLtableCustomerA))
datasetOrders.Tables("Orders") >>> the first column "orderID" is a primary unique key. Its structure is details below :
OrderID----OrderName----OrderCost--------Date
1----------A---------------54------------11/11/2010
2----------asdf------------45------------12/11/2010
3----------hrty------------89------------13/11/2010
4----------werff-----------36------------11/11/2010
5----------fgn------------154------------15/11/2010
datasetCustomers.Tablet("CustomerA") >>> contains only one column "orderID" which is a primary unique key.
OrdersID
1
3
4
datasetCustomers.Tablet("CustomerB") >>> contains only one column "orderID" which is a primary unique key.
OrdersID
3
4
5
The Qestion is :
When I click CustomerA >>> I need to display orders (assigned to CustomerA) into datagridview
OrderID----OrderName----OrderCost--------Date
1----------A---------------54------------11/11/2010
3----------hrty------------89------------13/11/2010
5----------fgn------------154------------15/11/2010
When I click CustomerB >>> I need to display orders (assigned to CustomerB) into datagridview
OrderID----OrderName----OrderCost--------Date
3----------hrty------------89------------13/11/2010
4----------werff-----------36------------11/11/2010
5----------fgn------------154------------15/11/2010
Please note that I had already made this by getting the data by SQL Statement
"Select SQLtableOrders.* , SQLtableCustomerA.orderID FROM SQLtableOrders , SQLtableCustomerA WHERE SQLtableOrders.orderID = SQLtableCustomerA.orderID"
It is really working fine , but the problem that it takes time to get data from the SQL server each time I disply orders. I already have the datasetOrders.Tables("Orders") data on the client PC , I need only to make the client PC extract which orders are assinged to a ceratin customers.
I can do it by For... Next , but I guess it will take time , specially if "orders" data contains many data .
Thanks,