i want to update row after union conection
code conect
Dim cmd As OleDbCommand = New OleDbCommand("SELECT tb1_type ,tb1_price FROM tb1 UNION SELECT tb2_supp,tb2_debt FROM tb2 UNION SELECT tb3_name,tb3_price FROM tb3", con)
con.Open()
DataAdapter1 = New OleDbDataAdapter(cmd)
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(DataAdapter1)
DataSet1 = New DataSet()
DataAdapter1.Fill(DataSet1, "tb1,tb2,tb3")
DataGridView1.DataSource = DataSet1
DataGridView1.DataMember = "tb1,tb2,tb3"
con.Close()
update not wrok
con.Open()
Dim Sav As New OleDb.OleDbCommand
Sav.Connection = con
Sav.CommandType = CommandType.Text
Sav.CommandText = "UPDATE TB1 SET TYPE_TB1 = or TYPE_TB2 = or TYPE_TB3 = '" & _
stock_add.TextBox1.Text & "' ,COUN_TB1 = or ,COUN_TB2 = or ,COUN_TB3 = '" & _
stock_add.TextBox2.Text & "' where ID_TB1 or ID_TB2 or ID_TB3 LIKE '" & _
stock_add.Label6.Text & "'"
Sav.ExecuteNonQuery()
DataSet1.Clear()
BindingSource1.EndEdit()
DataAdapter1.Fill(DataSet1, "TB1,TB2,TB3")
DataGridView1.Refresh()
If con.State = ConnectionState.Open Then
con.Close()
End If
MsgBox("update ok")