Mysql Net数据集可以';找不到桌子
我有个问题。我应该在一些表之间进行连接Mysql Net数据集可以';找不到桌子,mysql,vb.net,join,dataset,Mysql,Vb.net,Join,Dataset,我有个问题。我应该在一些表之间进行连接 sql = "select * from prodotto as p,fornitore as f,categoria as c where p.codice_fornitore=p.codice and p.codice_categoria=c.codice and p.codice='" & cod.Text & "'" 但是,当我可以用数据适配器填充数据集时,我应该使用哪个名称来引用查询结果。临时表是否具有默认名称?数据集中
sql = "select * from prodotto as p,fornitore as f,categoria as c where
p.codice_fornitore=p.codice and p.codice_categoria=c.codice and p.codice='" & cod.Text & "'"
但是,当我可以用数据适配器填充数据集时,我应该使用哪个名称来引用查询结果。临时表是否具有默认名称?数据集中的各个表可以由基于零的索引引用,因此您可以使用
数据集。表(0)
访问您的结果集,因为它似乎是查询中唯一的结果集。例如
Private Sub FilldgvMyGrid()
Dim SourceDataSet As New DataSet
Dim adapter As New NpgsqlDataAdapter("select * from prodotto as p,fornitore as
f,categoria as c where p.codice_fornitore=p.codice and p.codice_categoria=c.codice
and p.codice='" & cod.Text & "'", yourSqlConn)
adapter.Fill(SourceDataSet)
/*if you have a Datagridview called dgvMyGrid */
dgvMyGrid.DataSource = SourceDataSet.Tables(0)
End Sub