Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to change this code into vb.net
Message
From
01/07/2012 03:29:50
 
 
To
30/06/2012 18:32:10
Lam Hung
Truong Nguyen Co.,Ltd
Ho Chi Minh City, Vietnam
General information
Forum:
ASP.NET
Category:
Deployments
Environment versions
Environment:
VB 8.0
Miscellaneous
Thread ID:
01547319
Message ID:
01547369
Views:
44
Likes (1)
>Thank you very much for your reply. But the problem is , I only want to solve the problem on datatable not on sql server.
>For example, in visual fox, it allow us to use sql expression but datatable in vb.net is not.

Then you could use Linq to DS. eg.:
Dim list = ds.Tables("tb_ItemList").AsEnumerable()
Dim sublist = ds.Tables("SubList").AsEnumerable()

'Option 1
Dim result = From l In list Join sl In sublist On l.Field(Of Integer)("ItemCode") = sl.Field(Of Integer)("ItemCode") _
 Into tmp From tmp2 In tmp.DefaultIfEmpty() _
 Where tmp2 Is Nothingl

'Option 2
Dim subCodes = sublist.[Select](Function(x) x.Field(Of Integer)("ItemCode"))
Dim result2 = From r In list Where Not subCodes.Contains(r.Field(Of Integer)("ItemCode"))r
Disclaimer: auto converted from C# and not tested.....
Previous
Reply
Map
View

Click here to load this message in the networking platform