VB2005: Oracle tbl -> vb 2005 data tbl -> Oracle tbl
Hello, code gurus. I would be soooo grateful if anyone could help me with question.
I have a dataset created from a SQL query on an Oracle db. How do I write back the data, in Table = "Results0", to Oracle?
Code:
Private Sub pbResetRowID_Click(...)
'` Get data from Oracle
Dim strSQL As String = "SELECT * FROM TABLE_AB"
Dim objcommand As New OleDb.OleDbCommand(strSQL, objConnection)
Dim objdataadapter As New OleDb.OleDbDataAdapter(objcommand)
'` Save results locally
Dim objdatatable As New Data.DataTable("Results0")
objdataadapter.Fill(objdatatable)
Dim objDataRow As DataRow
' Seed the index
Dim nIdx As Int32 = 100
'` Walk down the rows
For Each objDataRow In objdatatable.Rows
'` Assign index
objDataRow.Item("IDX") = nIdx
'` Bump up index value
nIdx += 10
Next
'------------------------------------------
' Ok, now save the datatable in Oracle!
'------------------------------------------
Re: VB2005: Oracle tbl -> vb 2005 data tbl -> Oracle tbl
I don't use that method but I think you use a command builder to create the insert,update and delete statements for the dataset.
Re: VB2005: Oracle tbl -> vb 2005 data tbl -> Oracle tbl
Hi Gary,
Thanks for the suggestion. I am using this method because I want to step through the returned data set which you cannot do (as far as I can tell) when using a standard (SELECT, INSERT, DELETE, UPDATE) query in the design view.
I am a VB 2005 newbie so may be completely mistaken in my belief!