I am looking for example of reading one table using datareader and
updating
another with the values using a dataadapter.
'set up the dataset and adapter
dim con as new sqlconnection(<connectionstring and all that....>)
con.open
dim myAdapter as new sqlDataAdapter("Select * from TableA", con)
dim myDataset as new dataset
myAdapter.fill(myDataset, "TableA")
dim con as new sqlconnection(<connectionstring and all that....>)
dim cmd as new sqlCommand("Select * from TableB", con)
dim myReader as sqlDatareader = cmd.executeReader
while myReader.Read
dim newRow as datarow = myDataset.tables("TableA").Newrow
newRow.beginEdit
newRow("firstname") = myReader("firstname")
newRow("lastname") = myReader("lastname")
newRow.endEdit
myDataset.tables("TableA").Rows.add(newRow)
end while
myAdapter.Update(myDataset, "TableA")
con.close
'remember to cleanup after yourself....
.....just off the top of my head...
Jeppe Jespersen