0
これらのフィールドはすべて表示したいが、そのうち3つは異なるテーブルからのものです。VB.net Mysql 3テーブルへの結合
Dim sql As MySqlCommand = New MySqlCommand("SELECT tblproduct.ProductNo, tblgenericname.genericname, tblproduct.BrandName, tblproduct.Quantity, tblproduct.PurchasedDate, tblproduct.ExpirationDate from tblproduct, tblGenericName where tblproduct.Genericno = tblgenericname.genericno, tblcompany where tblproduct.CompanyNo = tblcompany.CompanyNo and tblcompany.CompanyName like '" & cmb_com_load.Text & "'order by BrandName", con)
Dim da As MySqlDataAdapter = New MySqlDataAdapter()
Dim ds As DataSet = New DataSet
da.SelectCommand = sql
da.Fill(ds, "rec")
DataGridView1.DataSource = ds
DataGridView1.DataMember = "rec"