Posted on 2004-10-27
In vb6 I had a function which would insert/update record(s). What I am looking for is the best way to duplicate this in vb.net.
The function would accept a disconnected recordset which contained one or more updated or inserted records. It would then create a connection to the relevant database, set the active connection for the passed thru disconnected recordset to the connection and then updatebatch would be used (rs.updatebatch adaffectall). This function would then sit in a dll and could be called from any app. ADOR recordsets were used.
So basically what I want to do in vb.net is something similar to the above. Any advice on how I should go about this would be greatly appreciated.
What I have at the moment are a couple of forms with grids and unbound controls on them. The user can add/edit records using the unbound controls. On the save event I want to do something similar as before in vb6. Put the data into a disconnected recordset and call a routine that will perform the update/insert for me.