Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Saving Data

Posted on 2004-10-27
3
Medium Priority
?
261 Views
Last Modified: 2010-04-23
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.
0
Comment
Question by:azrakdragon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
123654789987 earned 1000 total points
ID: 12419829
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.
http://www.vb-helper.com/howto_net_datagrid.html
0
 

Author Comment

by:azrakdragon
ID: 12419880
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.
0
 

Author Comment

by:azrakdragon
ID: 12419919
Looking at the link u sent me, there is enough info for me to write something reusable. Many thanks for the help.
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question