jagr12
asked on
Query datatable in LINQ
How can query datatable using linq and set the return value in a new datatable?
Dim dt As DataTable = From o In datableorder.Select 'Where u.Item("OrderHeader_Id") = Wherever value I want to pass to
datableorder
OrderHeader_Id username itemno zip
1 john a1111 11111
1 john b1111 22222
2 john c1111 33333
2 john c1111 11111
3 etc
Dim dt As DataTable = From o In datableorder.Select 'Where u.Item("OrderHeader_Id") = Wherever value I want to pass to
datableorder
OrderHeader_Id username itemno zip
1 john a1111 11111
1 john b1111 22222
2 john c1111 33333
2 john c1111 11111
3 etc
Let me clarify, you want to update a value in existing datatable?
ASKER
No, If I pass OrderHeader_Id 1 it should return only
1 john a1111 11111
1 john b1111 22222
1 john a1111 11111
1 john b1111 22222
ASKER
like Dim dt As DataTable = From o In datableorder.Select 'Where u.Item("OrderHeader_Id") = 1
this new dt datable should return only
1 john a1111 11111
1 john b1111 22222
this new dt datable should return only
1 john a1111 11111
1 john b1111 22222
ASKER
sorry, with header
like Dim dt As DataTable = From o In datableorder.Select 'Where u.Item("OrderHeader_Id") = 1
this new dt datable should return only
OrderHeader_Id username itemno zip
1 john a1111 11111
1 john b1111 22222
like Dim dt As DataTable = From o In datableorder.Select 'Where u.Item("OrderHeader_Id") = 1
this new dt datable should return only
OrderHeader_Id username itemno zip
1 john a1111 11111
1 john b1111 22222
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.