sql - An SqlParameter with ParameterName '@OE_PurchaseDate' is not contained by this SqlParameterCollection -
im getting error when changed textbox datetimepicker
here code
dim cmd sqlcommand = sqlconn.createcommand sqlconn.open() cmd.commandtype = commandtype.storedprocedure cmd.commandtext = "addofficeequipmentprofile" cmd.parameters("@oe_purchasedate").value = dtppurchasedate.value cmd.executenonquery() sqlconn.close
this stored procedure follows
create procedure addofficeequipmentprofile ( @oe_purchasedate smalldatetime, ) insert tblofficeequipmentprofile (oe_purchasedate) values (@oe_purchasedate) go
i think error message quite straightforward. need add parameter before attempting set value.
cmd.commandtext = "addofficeequipmentprofile" cmd.parameters.add("@oe_purchasedate",sqldbtype.smalldatetime) cmd.parameters("@oe_purchasedate").value = dtppurchasedate.value
Comments
Post a Comment