I am trying to make the following procedure work:
Private Sub PrintTicket(ByVal strArtist As String, ByVal dteConcertDate As Date, ByVal intSeatNumber As Int32)
PrintTicket(ArtistTextBox.Text, ConcertDateDTPicker.Value.Date, SeatTextBox.Text)
<display returned info in a messagebox ( I already have this code written)
End Sub
Then as a test, I use the following sample call:
PrintTicket(ArtistTextBox.Text, System.DateTime.Today, 6)
Now as I follow it through the debug, everything goes fine until it tries to put 6 into intSeatNumber. I get the following error:
InvalidCastException: Conversion from string "" to type 'Integer' is not valid.
Now I think I understand why this is crashing and I have tried using CInt in a couple of different places to make sure the string I take is an integer but with no luck.
Where am I messing this up? Thanks.
Enter your message below
Sign in or Join us (it's free).