Hi, I have one form with multiple reading data (using BindingSource) and I want to store those data + some text entry to third table (also using BindingSource DataGrid)
Is it possoble to do that using sql statement ? I have connection to database. Picture is to show what I have on my mind.
If someone can give me example, just as guidelines it would be great.
foe example, how to save into database
combobox1.text (PID)
textbox1.text (PVAL)
combobox3.text (Customer)
This is code on my form from attachment
Public Class Form2
Dim con As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\invoicedb.accdb")
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.Close()
Form1.Show()
End Sub
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'InvoicedbDataSet.rac' table. You can move, or remove it, as needed.
Me.RacTableAdapter.Fill(Me.InvoicedbDataSet.rac)
Try
con.Open()
If con.State = ConnectionState.Open Then
Label5.Text = "Connected"
Else
Label5.Text = "Not Connected"
End If
Catch ex As Exception
MsgBox(ex.Message)
Label5.Text = "Not Connected"
Finally
con.Close()
End Try
'TODO: This line of code loads data into the 'InvoicedbDataSet.invoice' table. You can move, or remove it, as needed.
Me.InvoiceTableAdapter.Fill(Me.InvoicedbDataSet.invoice)
'TODO: This line of code loads data into the 'InvoicedbDataSet.customer' table. You can move, or remove it, as needed.
Me.CustomerTableAdapter.Fill(Me.InvoicedbDataSet.customer)
'TODO: This line of code loads data into the 'InvoicedbDataSet.company' table. You can move, or remove it, as needed.
Me.CompanyTableAdapter.Fill(Me.InvoicedbDataSet.company)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
End Sub
Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs)
End Sub
End Class
Thanks