Click here to Skip to main content
15,921,793 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: dataset.acceptchange method.. Pin
Dave Kreskowiak19-Mar-07 8:51
mveDave Kreskowiak19-Mar-07 8:51 
GeneralRe: dataset.acceptchange method.. Pin
manni_n19-Mar-07 9:04
manni_n19-Mar-07 9:04 
GeneralRe: dataset.acceptchange method.. Pin
Dave Kreskowiak19-Mar-07 9:27
mveDave Kreskowiak19-Mar-07 9:27 
You don't have any code to write the dataset changes back to the database. You can use the same dataadapter object that you use to populate the dataset, but you have to give it the SqlCommands to make the Insert, Update, and Delete changes to the actual database. You can either do this by hand or, if you're old using a single table in your SELECT query, you can use the OleDbCOmmandBuilder class to make the other thre queries for you.

You could modify your code like this:
Dim da As New OleDbDataAdapter("select * from dbo_info where IDNo='" & Label2.Text & "' ", _
    "provider=microsoft.jet.oledb.4.0;data source=e:\new folder\testIP.mdb;")
Dim cb As OleDbCommandBuilder = New OleDbCommandBuilder(myDataAdapter)
 
Dim ds As New DataSet
da.Fill(ds)

You'd probably also want to make the DataSet and DataAdapter class-scope so you can use it from something like a "Submit" button.
When you want to save the changes back to the database:
da.Update(ds)



Dave Kreskowiak
Microsoft MVP - Visual Basic


GeneralRe: dataset.acceptchange method.. Pin
manni_n19-Mar-07 10:07
manni_n19-Mar-07 10:07 
GeneralRe: dataset.acceptchange method.. Pin
Dave Kreskowiak19-Mar-07 10:41
mveDave Kreskowiak19-Mar-07 10:41 
QuestionSyncoronize between sql2005 database Pin
Richard Segerlund19-Mar-07 5:37
Richard Segerlund19-Mar-07 5:37 
AnswerRe: Syncoronize between sql2005 database Pin
Dave Kreskowiak19-Mar-07 13:33
mveDave Kreskowiak19-Mar-07 13:33 
GeneralRe: Syncoronize between sql2005 database Pin
Richard Segerlund22-Mar-07 3:20
Richard Segerlund22-Mar-07 3:20 
Questionremoving xmlns="" [modified] Pin
ONeil Tomlinson19-Mar-07 4:48
ONeil Tomlinson19-Mar-07 4:48 
AnswerRe: removing xmlns="" Pin
Johan Hakkesteegt20-Mar-07 0:49
Johan Hakkesteegt20-Mar-07 0:49 
QuestionDo I need an adapter/connection to run an SQL statement? Pin
penguin500019-Mar-07 4:03
penguin500019-Mar-07 4:03 
AnswerRe: Do I need an adapter/connection to run an SQL statement? Pin
Christian Graus19-Mar-07 4:41
protectorChristian Graus19-Mar-07 4:41 
GeneralRe: Do I need an adapter/connection to run an SQL statement? Pin
penguin500019-Mar-07 6:02
penguin500019-Mar-07 6:02 
GeneralRe: Do I need an adapter/connection to run an SQL statement? Pin
Christian Graus19-Mar-07 7:09
protectorChristian Graus19-Mar-07 7:09 
QuestionHelp with StreamReader Pin
Brad^19-Mar-07 3:48
Brad^19-Mar-07 3:48 
AnswerRe: Help with StreamReader [modified] Pin
JUNEYT19-Mar-07 5:16
JUNEYT19-Mar-07 5:16 
GeneralRe: Help with StreamReader Pin
Brad^19-Mar-07 5:34
Brad^19-Mar-07 5:34 
GeneralRe: Help with StreamReader Pin
JUNEYT19-Mar-07 5:53
JUNEYT19-Mar-07 5:53 
GeneralRe: Help with StreamReader Pin
Brad^19-Mar-07 6:52
Brad^19-Mar-07 6:52 
GeneralRe: Help with StreamReader [modified] Pin
Brad^20-Mar-07 14:31
Brad^20-Mar-07 14:31 
GeneralRe: Help with StreamReader Pin
JUNEYT20-Mar-07 22:12
JUNEYT20-Mar-07 22:12 
QuestionHow to retrieve a value from application config file? [modified] Pin
JUNEYT19-Mar-07 3:17
JUNEYT19-Mar-07 3:17 
AnswerRe: How to retrieve a value from application config file? Pin
coolestCoder20-Mar-07 1:21
coolestCoder20-Mar-07 1:21 
GeneralRe: How to retrieve a value from application config file? Pin
JUNEYT20-Mar-07 2:10
JUNEYT20-Mar-07 2:10 
AnswerRe: How to retrieve a value from application config file? Pin
JenisysJohn11-Apr-07 8:14
JenisysJohn11-Apr-07 8:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.