April 7th, 2012, 11:56 PM
Need help in manipulating Database on VB.net
Good day Devshed Forums!
I've been reading quite a lot of threads here, and I finally decided to register for good. Atlast!
okay, I'm having a hard time on this "DVD Rental" Program with a button that is labeled "Rent DVD". I'm new in programming, please bare with me.
and the "Rent DVD Button" Contains the following codes:
Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
Dim i As Integer
Dim rmovie As String
Dim rserial As Integer
Dim rw As DataRow
'Add a new row to the Student table.
rw = Form3.Database2DataSet.Tables(0).NewRow
rmovie = InputBox("Enter Movie Name:")
rserial = InputBox("Enter Serial:")
rw.Item("Movie") = rmovie
rw.Item("Serial") = rserial
'Update the Student table in the testdb database.
i = Form3.Table2TableAdapter.Update(Form3.Database2DataSet)
Catch ex As Exception
'Displays number of rows updated.
-and this seems to be working. This will bring me on the next form with the stuffs that I've entered in the InputBox saved on a database.
My problem is, I want to create a conditional statement (maybe "If then") under a "Return DVD Button" that will provide an input box that will ask values of what DVD I want to return as well as its serial number and then checks if the serial number that I've entered is correct according on the database record.
BUT I have no idea of what codes I will be needing in order to have a conditional statement that will refer its values on the database records.
Is this idea possible? Could you guys help me with the codes that I will be needing, or give me a better idea?
Sorry If I can't provide photos for better reference. This forum wouldn't just allow new users like me to post URL's.
Additional Info: I'm using VS11.
April 8th, 2012, 09:11 PM
Do you have some code that isn't working? If so post a relevant snip and any errors or other steps you've taken to try to debug.
I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton