Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way to sort a collection
Message
De
31/01/2013 12:22:07
 
 
À
31/01/2013 12:09:30
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01564757
Message ID:
01564862
Vues:
35
>I did try to convert that line in VB.NET but no converter is able to.

It is a VB.NET line. Works for me. Try this (modified to use Rob's 'OrderByDescending):
Module Module1

   public oParametersDataDictionaryField As New Collection()

    Sub Main()

    	ParameterAddDataDictionaryField("One", 5)
		ParameterAddDataDictionaryField("Two", "Hello")
		ParameterAddDataDictionaryField("Alpha", DateTime.Now)
		ParameterAddDataDictionaryField("Zebra", "Hello")

		Dim result = oParametersDataDictionaryField.OfType(Of Object())().OrderByDescending(Function(x) x(0))
	End Sub

  Private  Function ParameterAddDataDictionaryField(tcField As String, toValue As Object) As Boolean
		oParametersDataDictionaryField.Add(New Object(4) {tcField, toValue, "", "", 0})
		Return True
	End Function
End Module
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform