Protected Sub joblistview1_ItemDataBound(sender As Object, e As ListViewItemEventArgs) Handles joblistview1.ItemDataBound Dim lbljobtype As Label = CType(e.Item.FindControl("JobTypeLabel"), Label) 'Dim lbljobtype As Label = CType(joblistview1.FindControl("JobTypeLabel"), Label) ' Dim jobtypelist As ArrayList = New ArrayList() 'Dim jobtypelist As List(Of String) 'Dim jobtype As String() 'jobtypelist = New List(Of String) Dim jobtypelist(ds.Tables(0).Rows.Count - 1) As String Dim i As Integer For i = 0 To ds.Tables(0).Rows.Count - 1 jobtypelist(i) = ds.Tables(0).Rows(i)("CardTypeRefId") If jobtypelist(i) = 243 Then lbljobtype.Text = "Field Job" ElseIf jobtypelist(i) = 244 Then lbljobtype.Text = "Workshop Job" End If Next End Sub
SELECT <other fields> ,CardTypeRefId CASE WHEN CardTypeRefId = 243 THEN 'Field Job' WHEN CardTypeRefId = 244 THEN 'Workshop Job' ELSE 'unknown' END AS JobDescription FROM <Table>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)