Saving Data

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
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 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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can use a DataAdapter and a datagrid to implement this functionality. DataAdapter fills a dataset that can be used as the datasource of the datagird. U can make additions,deletions and updates on the datagrid. Then call the dataset.GetChanges to get all the changes. Then call update method of the dataAdapter to transfer the records to the database.

U can use the followings.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
azrakdragonAuthor Commented:
Unfortunately the requirements are such that no changes may be made directly on the datagrid. All changes/additions are to be made using the unbound controls.
azrakdragonAuthor Commented:
Looking at the link u sent me, there is enough info for me to write something reusable. Many thanks for the help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.