Link to home
Start Free TrialLog in
Avatar of aborg85
aborg85

asked on

Inserting a row into a dataset using tableadapter.insert

               Try
                    LastticketNo += 1
                    MessageBox.Show(LastticketNo)
                    If Me.OutClass.Text = "Economy" Then
                        classtype = "Y"
                    Else : classtype = "C"
                    End If
                    ticketingTableAdapter.Insert(PNRNO, Integer.Parse(LastticketNo), Me.TitleCombo1.SelectedItem,     Me.FirstNameBox1.Text, Me.SurnameBox1.Text _
                    , Me.PassportBox1.Text, Me.OutFlightNo.Text, (CType(RSdepartDate.Text, Date)), True, classtype, "Tony", Date.Now)

 MessageBox.Show("ticket insert 1 ok")
                Catch ex As Exception
                    MessageBox.Show("Ticket 1 failed")
                End Try

this piece of code doesnt work for me.. no idea what is wrong with it.... NEED HELP badly guys..  it keeps giveing ticket 1 failed

is the date diclared well ((CType(RSdepartDate.Text, Date)),) not sure about that...

Basicly this is an airline reservation system,
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Put a breakpoint in your Catch block and see what the actual exception is.
Avatar of aborg85
aborg85

ASKER

Thanks for your response.

Can you suggest me some code to do the breakpoint pls.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aborg85

ASKER

Thanks Carl_tawn,

that simple little line of code, helped me find my prob...

Thanks again
Until next time.... which wont be far away