G
Guest
Hi all,
I have troublem to get parameters output to return value back. I'm using
SQLdatasource and stored procedure to get information and delete row from
gridview. I don't have any problems get information and display but when I
want to delete some row from gridview and return parameters output back with
status or some message, the parameter return dbNull value. Any ideas what is
happen? Here is my code:
-- SqlDataSourece --
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:cnFOE %>"
DeleteCommand="p_siteproject_delete_measure"
DeleteCommandType="StoredProcedure"
SelectCommand="p_siteproject_measure_installed"
SelectCommandType="StoredProcedure">
<DeleteParameters>
<asp:SessionParameter Name="SiteProjectID"
SessionField="siteprojectid" Type="Int32" />
<asp:SessionParameter Name="MeasureID"
SessionField="measureid" Type="Int32" />
<asparameter Direction="InputOutput" Name="mess"
Type="string" />
<asparameter Direction="InputOutput" Name="ret"
type="int16" />
</DeleteParameters>
<SelectParameters>
<asp:SessionParameter Name="SiteProjectId"
SessionField="siteprojectid" Type="Int32" />
<asp:SessionParameter Name="sectorcd"
SessionField="sectorcd" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
-- Call event --
Protected Sub SqlDataSource1_Deleted(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
Handles SqlDataSource1.Deleted
Dim strMess As String
strMess = e.Command.Parameters("@mess").Value
'Dim ireturn As Integer
'ireturn = e.Command.Parameters("@ret").Value
End Sub
-- stored procedure --
I can run stored procedure and see the parameters output
ALTER PROCEDURE [dbo].[p_siteproject_delete_measure]
@SiteProjectID Int = null,
@MeasureID Int = null,
@mess VarChar(255)= null OUTPUT,
@ret Int = null OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SET @mess = 'Will Delete this measure'
SET @ret = 2
END
Please help.
I have troublem to get parameters output to return value back. I'm using
SQLdatasource and stored procedure to get information and delete row from
gridview. I don't have any problems get information and display but when I
want to delete some row from gridview and return parameters output back with
status or some message, the parameter return dbNull value. Any ideas what is
happen? Here is my code:
-- SqlDataSourece --
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:cnFOE %>"
DeleteCommand="p_siteproject_delete_measure"
DeleteCommandType="StoredProcedure"
SelectCommand="p_siteproject_measure_installed"
SelectCommandType="StoredProcedure">
<DeleteParameters>
<asp:SessionParameter Name="SiteProjectID"
SessionField="siteprojectid" Type="Int32" />
<asp:SessionParameter Name="MeasureID"
SessionField="measureid" Type="Int32" />
<asparameter Direction="InputOutput" Name="mess"
Type="string" />
<asparameter Direction="InputOutput" Name="ret"
type="int16" />
</DeleteParameters>
<SelectParameters>
<asp:SessionParameter Name="SiteProjectId"
SessionField="siteprojectid" Type="Int32" />
<asp:SessionParameter Name="sectorcd"
SessionField="sectorcd" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
-- Call event --
Protected Sub SqlDataSource1_Deleted(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
Handles SqlDataSource1.Deleted
Dim strMess As String
strMess = e.Command.Parameters("@mess").Value
'Dim ireturn As Integer
'ireturn = e.Command.Parameters("@ret").Value
End Sub
-- stored procedure --
I can run stored procedure and see the parameters output
ALTER PROCEDURE [dbo].[p_siteproject_delete_measure]
@SiteProjectID Int = null,
@MeasureID Int = null,
@mess VarChar(255)= null OUTPUT,
@ret Int = null OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SET @mess = 'Will Delete this measure'
SET @ret = 2
END
Please help.