Inserting a row into a dataset using tableadapter.insert

Posted on 2006-04-03
Last Modified: 2013-12-25
                    LastticketNo += 1
                    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,
Question by:aborg85
    LVL 52

    Expert Comment

    by:Carl Tawn
    Put a breakpoint in your Catch block and see what the actual exception is.

    Author Comment

    Thanks for your response.

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

    LVL 52

    Accepted Solution

    Well, to start just add the following line into your catch block:


    Author Comment

    Thanks Carl_tawn,

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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now