Results 1 to 3 of 3

Thread: how to update data using dataset?

  1. #1

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

    how to update data using dataset?

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

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

    So I want to update the data using above dataset,help me regarding this?

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Are you getting any errors? Looking over the code, that seems about right.
    Dont gain the world and lose your soul

  3. #3
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    We cant help you if you dont answer back to questions asked of you. You have already asked this once, and you never responded to my question. And emailing me with the same exact vague post is also not going to get you an answer.
    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