how to update the different text in vb to the same field in oracle
my code is below

If ar.BOF = False Then
ar.MoveFirst
ar.AddNew
ar.Fields(0) = registernumber1.Text
ar.Fields(1) = name1.Text
ar.Fields(2) = status1.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text

ar.Fields(0) = registernumber2.Text
ar.Fields(1) = name2.Text
ar.Fields(2) = status2.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text

ar.Fields(0) = registernumber3.Text
ar.Fields(1) = name3.Text
ar.Fields(2) = status3.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text

ar.Fields(0) = registernumber4.Text
ar.Fields(1) = name4.Text
ar.Fields(2) = status4.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text

ar.Fields(0) = registernumber5.Text
ar.Fields(1) = name5.Text
ar.Fields(2) = status5.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text

ar.Fields(0) = registernumber6.Text
ar.Fields(1) = name6.Text
ar.Fields(2) = status6.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text

ar.Fields(0) = registernumber7.Text
ar.Fields(1) = name7.Text
ar.Fields(2) = status7.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text

ar.Fields(0) = registernumber8.Text
ar.Fields(1) = name8.Text
ar.Fields(2) = status8.Text
ar.Fields(3) = Form9.batch.Text
ar.Fields(4) = Form9.year.Text
ar.Fields(5) = Form9.department.Text
ar.Fields(6) = Form9.semester.Text
ar.Fields(7) = Form9.section.Text
ar.Fields(8) = Form9.currentdate.Text
ar.Fields(9) = Form9.subjectcode.Text
ar.Fields(10) = Form9.facultyname.Text
ar.Update
MsgBox "UPDATED SUCCESSFULLY"
ar.Close
ar.Open "commit"
End If

reply fast

You need to update after adding each set of values otherwise only the last bunch of values will over write all other previous values.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.