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
Try
DataSet11.Tables(0).Rows.Add(rw)
'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
MessageBox.Show(ex.Message)
End Try
End Sub
Enter your message below
Sign in or Join us (it's free).