Results 1 to 2 of 2

Thread: how to update data in vb.net by using ado.net and oracle as database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2002
    Location
    hyderabad
    Posts
    18

    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")

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    So whats the question? You posted a sample, but what is wrong with it that you cants use it?
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width