|
-
May 30th, 2007, 02:21 PM
#1
Thread Starter
New Member
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!
'------------------------------------------
-
May 30th, 2007, 02:30 PM
#2
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.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
May 30th, 2007, 02:36 PM
#3
Thread Starter
New Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|