how to update record in database??

  • 13 years ago

    I have a problem with updating the record into database, can someone help me??
    following is the code that i used to add new record into database (this code i get it from internet)
    but, i dont know how to update the record.please help.

           Dim i As Integer
           Dim Cname, ReservationNo, CarNo, LotNo, CID As String
           Dim rw As DataRow
           'Dim ReservationDate As Date

           ReservationNo = InputBox("Enter the Reservation no:")
           CID = InputBox("Enter the customer ID:")
           Cname = InputBox("Enter the Name of the Customer:")
           CarNo = InputBox("Enter the Car no:")
           rw.Item("ReservationNo") = ReservationNo
           rw.Item("CustomerID") = CID
           rw.Item("Name") = Cname
           rw.Item("ReservationDate") = ReservationDate
           rw.Item("CarNo") = CarNo
               'Update the reservation table in the db database.
               i = OleDbDataAdapter2.Update(DataSet11)
               MessageBox.Show("New record has been added into database")
           Catch ex As Exception
           End Try

      End Sub

  • 13 years ago


    I suggest you take a read of . This gives you an intro to ADO.NET and how to update records

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why.”