Posted on: 4/27/2011 6:07:32 AM | Views : 301

I have a table called passenger with Passenger_id as primary key, autoincrement property is on
The issue is: how could i insert into this table without adding value to the primary key(autoincrement) using SQL statment(INSERT INTO TABLE)
here is the code that i tried with 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,@Cridetcard)", BookConn) 'BookCommand.Parameters.Add("@ID", Data.SqlDbType.Int) BookCommand.Parame ...

Go to the complete details ...