thanks
I'm getting the error
An SqlParameter with ParameterName '@Booking_Number' is
not contained by this SqlParameterCollection.
heres the code
Dim TCatCmd As New SqlClient.SqlCommand
TCatCmd.Connection = TcatCon
TCatCmd.CommandType = CommandType.Text
TCatCmd.CommandText = "Select
Booking_Master.bookingID From BOOKING_MASTER WHERE
BOOKING_NUMBER = @Booking_Number"
TCatCmd.Parameters("@Booking_Number").Value =
1000000735356
any ideas?
thanks
mark
-----Original Message-----
Select Booking_Master.bookingID From BOOKING_MASTER
WHERE BOOKING_NUMBER =@Booking_Number"
Cmd.Parameters("@Booking_Number") = 1
and use cmd.ExecuteScalar() method
regards,
Jignesh
"Mark" <an*******@discussions.microsoft.com> wrote in
messagenews:09****************************@phx.gbl... Hi
I want to return the ID of a table based on a select
I've not tested the following code, does it look ok?
<code>
Dim Con As New SqlClient.SqlConnection
Con.ConnectionString =
ConfigurationSettings.AppSettings("ConnString")
Con.Open()
'generate select statement
Dim Cmd As New SqlClient.SqlCommand
Cmd.Connection = Con
Cmd.CommandType = CommandType.Text
Cmd.CommandText = "Select * From BOOKING_MASTER
WHERE BOOKING_NUMBER = @Booking_Number"
Cmd.Parameters("@Booking_Number") = 1
'return the Booking_Master.bookingID to a variable here
</Code>
can any one help with returning the ID and telling me
if the code looks ok?
Thanks
Mark
.