ALTER PROCEDURE
dbo.Default_Edit1(@.ID
int,@.Family
Nvarchar(100)OutPut)
AS
/* SET NOCOUNT ON */SELECT@.Family=FamilyFROMTable1where(ID=@.ID)
RETURN
SqlDataSource1.SelectParameters.Add(
"ID",Me.GridView1.DataKeys(CInt(e.CommandArgument)).Item(0))SqlDataSource1.DeleteCommandType = SqlDataSourceCommandType.StoredProcedure
SqlDataSource1.SelectCommand =
"dbo.Default_Edit1"SqlDataSource1.SelectParameters(
"Family").Direction = Data.ParameterDirection.OutputLabel3.Text = SqlDataSource1.SelectParameters(
"Family").Direction.ToString()
it's have error
I went to return 1 fild
??
Remember that parameters names should be the same in SQL and .Net so use @.ID and @.Famile in both places.
Also do not forget to execute your command before you read output value. Are you sure that you will run your SP as delete command?
SqlDataSource1.SelectParameters.Add("@.ID",Me.GridView1.DataKeys(CInt(e.CommandArgument)).Item(0))
SqlDataSource1.SelectParameters(
"@.Family").Direction = Data.ParameterDirection.Output
Label3.Text = SqlDataSource1.SelectParameters("@.Family").Direction.ToString()
thanks
|||Its'not Work!
No comments:
Post a Comment