ERROR: Parameter1 is not a parameter for procedure Workflow_SPWipTransfer
cmd = New SqlCommand()
cmd.Connection = objConn
cmd.CommandText = "Workflow_SPWipTransfer"
cmd.CommandType = CommandType.StoredProcedure
'Parameters
parDate = cmd.CreateParameter
parDate.ParameterName = "@tDate"
parDate.Direction = ParameterDirection.Input
parDate.SqlDbType = SqlDbType.DateTime
parDate.Value = transDate
cmd.Parameters.Add(parDate)
parItems = cmd.CreateParameter
parItems.ParameterName = "@tItems"
parItems = cmd.CreateParameter
parItems.Direction = ParameterDirection.Input
parItems.SqlDbType = SqlDbType.VarChar
parItems.Value = list
cmd.Parameters.Add(parItems)
parDesc = cmd.CreateParameter
parDesc.ParameterName = "@tDesc"
parDesc = cmd.CreateParameter
parDesc.Direction = ParameterDirection.Input
parDesc.SqlDbType = SqlDbType.VarChar
parDesc.Value = transDesc
cmd.Parameters.Add(parDesc)
parToClient = cmd.CreateParameter
parToClient.ParameterName = "@tClientID"
parToClient = cmd.CreateParameter
parToClient.Direction = ParameterDirection.Input
parToClient.SqlDbType = SqlDbType.Int
parToClient.Value = toClientID
cmd.Parameters.Add(parToClient)
parToJob = cmd.CreateParameter
parToJob.ParameterName = "@tJobID"
parToJob = cmd.CreateParameter
parToJob.Direction = ParameterDirection.Input
parToJob.SqlDbType = SqlDbType.Int
parToJob.Value = toJobID
cmd.Parameters.Add(parToJob)
cmd.ExecuteNonQuery()
objConn.Close()
HERE IS THE SP
=============================
CREATE procedure Workflow_SPWipTransfer @tDate datetime, @tItems varchar(8000), @tdesc varchar(8000), @tClientID int, @tJobID int
as
--------------------------------------------------------------------------------------------------------
insert into tblwip (approved,date,clientid,jobid,staffid,chargeacid,chargetypeid,controlchargeacid,
costrate,rate,units,amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,detail,profitloss,dotransfer,stafftypeid,ratetype)
select approved,@tDate,clientid,jobid,staffid,135,chargetypeid,controlchargeacid,costrate,rate,units,
(amount * -1) as amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,'['+ str(wipID) +'] '+ @tdesc,profitloss,0 as doTransfer,stafftypeid,ratetype
from tblwip where wipid in (@tItems)
--------------------------------------------------------------------------------------------------------
--This is to add TRANSFER records
--------------------------------------------------------------------------------------------------------
insert into tblwip (approved,date,clientid,jobid,staffid,chargeacid,chargetypeid,controlchargeacid,
costrate,rate,units,amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,detail,profitloss,dotransfer,stafftypeid,ratetype)
select approved,@tDate,@tClientID,@tJobID,staffid,135,chargetypeid,controlchargeacid,costrate,rate,units,
(amount * -1) as amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,'['+ str(wipID) +'] '+ @tdesc,profitloss,dotransfer,stafftypeid,ratetype
from tblwip where wipid in (@tItems)
--------------------------------------------------------------------------------------------------------
--This updates the job partner id and manager id
--------------------------------------------------------------------------------------------------------
update tblwip
set jobpartnerid = b.partnerid,
jobmanagerid = b.managerid
from tblJob b
where tblwip.jobid = b.jobid and tblwip.date = @tdate and tblwip.chargeacid = 135
--------------------------------------------------------------------------------------------------------
--This updates the doTransfer field
--------------------------------------------------------------------------------------------------------
update tblwip
set doTransfer = 0
where wipid in (@tItems)
--------------------------------------------------------------------------------------------------------
GO
Don't understand why this error is occurring?
DLC
cmd = New SqlCommand()
cmd.Connection = objConn
cmd.CommandText = "Workflow_SPWipTransfer"
cmd.CommandType = CommandType.StoredProcedure
'Parameters
parDate = cmd.CreateParameter
parDate.ParameterName = "@tDate"
parDate.Direction = ParameterDirection.Input
parDate.SqlDbType = SqlDbType.DateTime
parDate.Value = transDate
cmd.Parameters.Add(parDate)
parItems = cmd.CreateParameter
parItems.ParameterName = "@tItems"
parItems = cmd.CreateParameter
parItems.Direction = ParameterDirection.Input
parItems.SqlDbType = SqlDbType.VarChar
parItems.Value = list
cmd.Parameters.Add(parItems)
parDesc = cmd.CreateParameter
parDesc.ParameterName = "@tDesc"
parDesc = cmd.CreateParameter
parDesc.Direction = ParameterDirection.Input
parDesc.SqlDbType = SqlDbType.VarChar
parDesc.Value = transDesc
cmd.Parameters.Add(parDesc)
parToClient = cmd.CreateParameter
parToClient.ParameterName = "@tClientID"
parToClient = cmd.CreateParameter
parToClient.Direction = ParameterDirection.Input
parToClient.SqlDbType = SqlDbType.Int
parToClient.Value = toClientID
cmd.Parameters.Add(parToClient)
parToJob = cmd.CreateParameter
parToJob.ParameterName = "@tJobID"
parToJob = cmd.CreateParameter
parToJob.Direction = ParameterDirection.Input
parToJob.SqlDbType = SqlDbType.Int
parToJob.Value = toJobID
cmd.Parameters.Add(parToJob)
cmd.ExecuteNonQuery()
objConn.Close()
HERE IS THE SP
=============================
CREATE procedure Workflow_SPWipTransfer @tDate datetime, @tItems varchar(8000), @tdesc varchar(8000), @tClientID int, @tJobID int
as
--------------------------------------------------------------------------------------------------------
insert into tblwip (approved,date,clientid,jobid,staffid,chargeacid,chargetypeid,controlchargeacid,
costrate,rate,units,amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,detail,profitloss,dotransfer,stafftypeid,ratetype)
select approved,@tDate,clientid,jobid,staffid,135,chargetypeid,controlchargeacid,costrate,rate,units,
(amount * -1) as amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,'['+ str(wipID) +'] '+ @tdesc,profitloss,0 as doTransfer,stafftypeid,ratetype
from tblwip where wipid in (@tItems)
--------------------------------------------------------------------------------------------------------
--This is to add TRANSFER records
--------------------------------------------------------------------------------------------------------
insert into tblwip (approved,date,clientid,jobid,staffid,chargeacid,chargetypeid,controlchargeacid,
costrate,rate,units,amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,detail,profitloss,dotransfer,stafftypeid,ratetype)
select approved,@tDate,@tClientID,@tJobID,staffid,135,chargetypeid,controlchargeacid,costrate,rate,units,
(amount * -1) as amount,billed,postedbystaffid,apprbystaffid,partnerid,managerid,jobpartnerid,
jobmanagerid,'['+ str(wipID) +'] '+ @tdesc,profitloss,dotransfer,stafftypeid,ratetype
from tblwip where wipid in (@tItems)
--------------------------------------------------------------------------------------------------------
--This updates the job partner id and manager id
--------------------------------------------------------------------------------------------------------
update tblwip
set jobpartnerid = b.partnerid,
jobmanagerid = b.managerid
from tblJob b
where tblwip.jobid = b.jobid and tblwip.date = @tdate and tblwip.chargeacid = 135
--------------------------------------------------------------------------------------------------------
--This updates the doTransfer field
--------------------------------------------------------------------------------------------------------
update tblwip
set doTransfer = 0
where wipid in (@tItems)
--------------------------------------------------------------------------------------------------------
GO
Don't understand why this error is occurring?
DLC