Set RS = New ADODB.Recordset
sSQL = "SELECT courses.id AS courses_id, courses.title as courses_title, courses.description, "
sSQL = sSQL & " courses.dept_id, users.id, users.name, dept.id, dept.title "
sSQL = sSQL & " FROM courses "
sSQL = sSQL & " LEFT OUTER JOIN users ON "
sSQL = sSQL & " courses.user_id = users.id "
sSQL = sSQL & " LEFT OUTER JOIN dept ON "
sSQL = sSQL & " dept_id = dept.id "
RS.Open sSQL, CN, 3, 4
With lvw_CRS
.ListItems.Clear
.IconSize = 16
.Icons.LoadIcon App.Path & "\ac_icons\folder.ico", 1, xtpImageNormal
<----------------- how do i translate this to VB.NET Codes ------------------>
While Not RS.EOF
.ListItems.Add , , RS.Fields("courses_title"), 1
.ListItems(.ListItems.Count).SubItems(1) = RS.Fields("description") & ""
.ListItems(.ListItems.Count).SubItems(2) = RS.Fields("title") & ""
.ListItems(.ListItems.Count).SubItems(3) = RS.Fields("name") & ""
.ListItems(.ListItems.Count).SubItems(4) = RS.Fields("courses_id") & ""
RS.MoveNext
Wend
End With
<------------------------------------------------------------------------------>
This post has been edited by macosxnerd101: 28 November 2010 - 09:29 PM
Reason for edit:: Please use code tags

New Topic/Question
Reply




MultiQuote







|