i'm new to vb.net and i cant figure out how to solve this problem
any help would be greatly appreciated
how can i show data into list view if the data is located in different tables.
here few of my code,
Public strConn As String = "C:\*********.mdb"
Public cn As New OleDb.OleDbConnection
Private Sub open_connection()
close_connection()
cn.ConnectionString = "provider=microsoft.jet.oledb.4.0; data source= " & strConn
If cn.State = ConnectionState.Closed Then
cn.Open()
End If
End Sub
Private Sub load_data()
open_connection()
Dim a As Integer
Dim da As New OleDb.OleDbDataAdapter("Select * from tblstock", cn)
Dim ds As New DataSet
da.Fill(ds)
lststock.Items.Clear()
For a = 0 To ds.Tables(0).Rows.Count - 1
lststock.Items.Add(ds.Tables(0).Rows(a).Item("Brand_Name"))
lststock.Items(a).SubItems.Add(ds.Tables(0).Rows(a).Item("Generic_Name"))
Next
close_connection()
End Sub
the problem is i dont know how to display to the list view the other data that is located in another table.