hi there..
im having trouble with my codes for inner join.. actually. i think my sql inner join is correct but the codes succeeding are in wrong format . please anyone help me ,,
ihave tables... namely tblproduct, tblsupplier, tblproductline, tblartist
here's my code..
Public cs As String = "Server=localhost;User Id=root;Password=;Database=koninventory"
Public sqlConn As MySqlConnection = New MySqlConnection
sqlConn.ConnectionString = cs
Try
If sqlConn.State = ConnectionState.Closed Then
sqlConn.Open()
Else
sqlConn.Close()
MsgBox("ERROR")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Dim query As String = "SELECT tblproduct.Product_ID, tblproduct.Product_Name, tblproduct.Product_Desc, tblproduct.Product_Category, tblproduct.Availability, tblproduct.Unit_Price, tblproduct.Selling_Price, tblsupplier.Supplier_Name, tblproductline.Product_Line_Desc, tblartist.Artist_Name FROM ((tblproduct INNER JOIN tblproductline ON tblproduct.Product_Line_ID = tblproductline.Product_Line_ID) INNER JOIN tblartist ON tblproduct.Artist_ID tblartist.Artist_ID) INNER JOIN tblsupplier ON tblproduct.Supplier_ID = tblsupplier.Supplier_ID;"
Dim da As New MySqlDataAdapter(query, sqlConn)
Dim ds As New DataSet
da.Fill(ds, "tblproduct") --> what table am i going to put here?
gridProductList.DataSource = ds.Tables("tblproduct") --> also here
sqlConn.Close()
ARE MY CODES CORRECT?


Reply With Quote

