|
-
May 2nd, 2003, 07:03 AM
#1
Thread Starter
Junior Member
how to update data in vb.net by using ado.net and oracle as database
This is sample code for connecting to database and Inserting values into oracle database.
I want to update the Record,please help me regarding this.
Dim Cn As String
Dim strprovider As String = New String("MSDAORA")
Dim strdatasource As String = New String("HMWORA01")
Dim struserid As String = New String("sysedp")
Dim strpass As String = New String("sysedp")
Cn = "Provider=" & strprovider & ";Data Source=" & strdatasource & ";User Id=" & struserid & ";Password=" & strpass & ";"
Dim Conn As New OleDb.OleDbConnection(Cn)
MsgBox("Connected")
'Below code is used to inserting data into oracle database
conn.Open()
objDA = New OleDb.OleDbDataAdapter("select * from makemast", conn)
objcb = New OleDb.OleDbCommandBuilder(objDA)
objDA.Fill(objds, "makemast")
objRow = objds.Tables(0).NewRow
objRow("makecd") = UCase(Trim(Text1.Text))
objRow("makename") = UCase(Trim(Text2.Text))
objds.Tables("makemast").Rows.Add(objRow)
objDA.Update(objds, "makemast")
MsgBox("Inserted")
-
May 2nd, 2003, 08:12 AM
#2
So whats the question? You posted a sample, but what is wrong with it that you cants use it?
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
|