Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting Columns from LINQ List
Message
De
03/07/2011 18:41:06
 
 
À
03/07/2011 16:58:34
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01517212
Message ID:
01517222
Vues:
66
This message has been marked as the solution to the initial question of the thread.
>I don't think this works since the error (in the vs before starting the debug) if in the ToDataTable() function.
>
> Public Shared Function ToDataTable(ByVal data As IList(Of T)) As DataTable
>
>the above shows an error at the "T"


Perhaps that's not the correct VB syntax? I don't know, I've tried a couple of the online converters (going in both directions VB to C# and C# to VB) and they seem to have issues with generics. In C#, I believe the method signature would look like this:
public static DataTable ToDataTable<T>(IList<T> data)
Actually, I think I've found one converter that may work. Try the following syntax instead:
Public Shared Function ToDataTable(Of T)(data As IList(Of T)) As DataTable
End Function
If this works, then this converter is much better than the ones I've been using. It can be found at:
http://www.developerfusion.com/tools/convert/csharp-to-vb/
http://www.developerfusion.com/tools/convert/vb-to-csharp/

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform