NotSoCunning
Technical User
Hi guys,
I'm having a bit of a nightmare with using parameters for updating a record within my database. It keeps throwing the following error
"Parameter @desc has no default value"
The code that deals with the parameters is as follows:
I've google'd and searched the forums but nothing seems to solve this problem. The variables assigned are set by textbox's and are all correct according to traces. I have an insert statement which runs off the same parameters which runs fine. I'm totally puzzled, any suggestions welcome.
I'm having a bit of a nightmare with using parameters for updating a record within my database. It keeps throwing the following error
"Parameter @desc has no default value"
The code that deals with the parameters is as follows:
Code:
sSQL = "UPDATE req SET strReqNo=@reqno, fkContractID=@contractid, strDescription=@desc, intValue=@value, intCostPlus=@costplus, strDesignBy=@desby, dteIssue=@isson, strIssueBy=@issby WHERE pkJobCardNo=@jcno"
cmd = New System.Data.OleDb.OleDbCommand(sSQL, dbcon)
dba.UpdateCommand = cmd
cmd.Parameters.Add("@jcno", OleDb.OleDbType.Integer).Value = jcno
cmd.Parameters.Add("@reqno", OleDb.OleDbType.Char).Value = reqno
cmd.Parameters.Add("@contractid", OleDb.OleDbType.Integer).Value = text
cmd.Parameters.Add("@desc", OleDb.OleDbType.Char).Value = desc
cmd.Parameters.Add("@value", OleDb.OleDbType.Currency).Value = value
cmd.Parameters.Add("@costplus", OleDb.OleDbType.Currency).Value = costplus
cmd.Parameters.Add("@desby", OleDb.OleDbType.Char).Value = desby
cmd.Parameters.Add("@isson", OleDb.OleDbType.Char).Value = isson
cmd.Parameters.Add("@issby", OleDb.OleDbType.Char).Value = issby
dbcon.Open()
cmd.ExecuteNonQuery()
dbcon.Close()
I've google'd and searched the forums but nothing seems to solve this problem. The variables assigned are set by textbox's and are all correct according to traces. I have an insert statement which runs off the same parameters which runs fine. I'm totally puzzled, any suggestions welcome.