Fail to update a record by using store procedure

A

Agnes

Please someone be kind to check my code, I don't know what's wrong

Dim cmdUpdate As New SqlCommand()
With cmdUpdate
.Connection = conSea
.CommandText = "dbo.seaexhbl_update"
.CommandType = CommandType.StoredProcedure
End With
Dim prmUpdate
prmUpdate = cmdUpdate.Parameters.Add("@jobno", SqlDbType.Char, 20,
Trim(Me.txtJobNo.Text))
prmUpdate.direction = input

my procedure is
REATE PROCEDURE dbo.seaexhbl_update2
@jobno char(20) ,@hblno char(20),@jobperiod char(6)
as
DECLARE @error int,@rowcount int
update billladingheader
SET number=@hblno,jobno=@jobno,jobperiod=@jobperiod


There is an error [procedure dbo.seaexhbl_update expects '@jobno',which was
not supplied]
 
A

Agnes

Thanks Cor, I understand i am confuse about adapter and sqlcommand,
I post my problem in the recent post. Please feel free to take a look.
thanks for your help

From Agnes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top