Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to sort a collection
Message
From
31/01/2013 12:22:07
 
 
To
31/01/2013 12:09:30
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01564757
Message ID:
01564862
Views:
36
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform