Difference between revisions of "List Sort"

From Logic Wiki
Jump to: navigation, search
(Created page with "Category:VB.NET Category:Lambda To sort a list in vb.net Dim oEmpleyee As New List(Of Common.Employee) For z As Integer = 0 To sCSVArr.Length - 1 Dim...")
 
m (1 revision imported)
 
(No difference)

Latest revision as of 13:27, 9 May 2016


To sort a list in vb.net

Dim oEmpleyee As New List(Of Common.Employee)
For z As Integer = 0 To sCSVArr.Length - 1
           Dim oEmp As New Common.Employee
           Dim sCSVLine As String() = Split(sCSVArr(z), ",")
           oEmp.EmployeeID = sCSVLine(0)
           oEmp.Title = sCSVLine(1)
           oEmp.Forename1 = sCSVLine(2)
           oEmpleyee.Add(oEmp)
 Next
oEmpleyee = oEmpleyee .OrderBy(Function(x) x.EmployeeID ).ToList()