gpt4 book ai didi

mysql - VB.Net DataSet找不到表

转载 作者:行者123 更新时间:2023-11-29 07:54:20 25 4
gpt4 key购买 nike

我有一个问题。我应该在一些表之间进行连接

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 & "'"

 
但是当我可以使用数据适配器填充数据集时,我应该使用哪个名称来引用查询结果。是具有默认名称的临时表吗?

最佳答案

例如,

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

关于mysql - VB.Net DataSet找不到表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25548280/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com