Reputation: 463
This question title matches with other but not the scenario,
here am getting data form a table A and based on it, updating table B and inserting a record in table C, so to make this a grouped these queries a transaction but in run time getting this error, everything seems to be correct, worked on the same scenario in c#.net and working fine but it is the first time trying to apply in vb.net getting error any help would be appreciated
the error will be in the following line
cmd = New OleDbCommand(sql, CON1, transaction)
Upvotes: 0
Views: 700
Reputation: 1265
This code is unnecessary:
If CON1.State Then Con1.Close()
CON1.Open()
Your connection CON1
associated with transaction
has closed then the transaction has ended.
Upvotes: 1