|
-
May 1st, 2009, 07:35 AM
#1
Thread Starter
Member
How to update table from multiple grid selection
Hello,
I need to update a link Table with the data I select from multiple grids, the problem is only the last command statement takes effect, therefore I am only updating the link table from the last command statement, is there a way to update the link table with all the command statements?
Thanks,
Code:
Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\aop29.mdb"
Dim objConnection As New OleDb.OleDbConnection(ConnectionString)
Dim sql As String = "Select * from Link_TableA"
Dim daaop5 As New OleDb.OleDbDataAdapter(sql, objConnection)
Dim ds As New DataSet()
Dim dsA As New DataSet()
daaop5.Fill(ds)
daaop5.Update(ds)
C1TrueDBGrid1.AllowAddNew = True
daaop5.SelectCommand.CommandText = ("INSERT INTO Link_TableA(COMPANY_ID) VALUES('" & C1TrueDBGrid1.Columns(0).Value & "')")
daaop5.SelectCommand.CommandText = ("INSERT INTO Link_TableA(Receiver_ID) VALUES('" & C1TrueDBGrid2.Columns(0).Value & "')")
daaop5.Fill(ds)
daaop5.Update(ds)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|