Code Error While Using SQL Output and ASP.NET -
i have below stored procedure in sql server 2008 not generating errors in sql, generating 1 in web application states "'getgeninfo_delete01_01_22' expects parameter '@fpath', not supplied". novice @ sql, trying return field vb.net before row deleted. suggestions helpful.
alter procedure [dbo].[getgeninfo_delete01_01_22] @idx int, @fpath varchar(100) output begin select @fpath = (select filepath geninfo_e1_01_22 id=@idx) delete geninfo_e1_01_22 id = @idx end
here vb code calling stored proc
using con new sqlconnection(connstr) using cmd new sqlcommand() cmd.commandtype = commandtype.storedprocedure cmd.commandtext = "getgeninfo_delete01_01_22" cmd.parameters.add("idx", id) dim returnparameter = cmd.parameters.add("@fpath", sqldbtype.varchar) returnparameter.direction = parameterdirection.returnvalue cmd.connection = con con.open() gridview1.datasource = cmd.executereader() gridview1.databind() con.close() end using end using
you're creating parameter returnparameter
, you're not adding parameters collection. use cmd.parameters.add(returnparameter)
prior db call.
Comments
Post a Comment