I'm trying to insert data to a database
But after pressing the button it show me thos error messege
Failed to convert parameter value from a String to a Int32.
help me please ....ans here the code
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim BookSource As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Abdelellah\My Documents\Downloads\Compressed\BOOKING.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"
Dim BookConn As SqlConnection = New SqlConnection(BookSource)
Dim BookCommand As SqlCommand = New SqlCommand(" INSERT INTO Passengers values(@ID,@FirstName,@LastName,@Gender,@Age,@Phone,@Fax,@Nationality,@Address,@Email)", BookConn)
BookCommand.Parameters.Add("@ID", Data.SqlDbType.Int, 50)
BookCommand.Parameters.Add("@FirstName", Data.SqlDbType.Char, 50)
BookCommand.Parame ...
Go to the complete details ...