Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to change this code into vb.net
Message
De
01/07/2012 03:29:50
 
 
À
30/06/2012 18:32:10
Lam Hung
Truong Nguyen Co.,Ltd
Ho Chi Minh City, Vietnam
Information générale
Forum:
ASP.NET
Catégorie:
Déploiements
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01547319
Message ID:
01547369
Vues:
45
J'aime (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.....
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform