Question SQL nonQuery execution error

hpbhathiya

New member
Joined
Jul 1, 2010
Messages
3
Programming Experience
Beginner
Dim cmd2 As New SqlCommand("INSERT INTO Passengers (FlightNo, TravelDate, FName, LName, Age, Gender, Class, SeatPref, MealPref, SSR, Status) VALUES ('" & flightNo & "','" & dateStr & "','" & fnametxt.Text & "','" & lnametxt.Text & "','" & agetxt.Text & "','" & genderdropdown.Text & "','" & classdropdown.Text & "','" & seatpreftxt.Text & "','" & mealPrefdropdown.Text & "','" & SSR.Text & "','reserved')", DBConnection)
cmd2.ExecuteNonQuery()

i get following error in the execution
String or binary data would be truncated.
The statement has been terminated.

Please help me out... :(
 
Top Bottom