sqldatasource using a stored procedure with OUTPUT parameters only

Discussion in 'ASP .Net' started by Andy in South Jersey, Feb 11, 2009.

  1. I have a sqldatasource control that has SelectCommand set to StoredProcedure,
    and that stored procedure only returns OUTPUT parameters, it doesn't return a
    recordset. It has one INPUT parameter. I would like to set the OUTPUT
    values that are returned by the SP to the text value of labels that I have on
    my page.

    When I configure the datasource I set the Direction to Output, I then
    "Finish" and when I go back to the configuration it says InputOutput, but the
    source code says:

    <asp:parameter Direction="Output" Name="weight" Type="Int32" />

    So, that was an initial concern, but I don't think that's the problem.

    Via SQL Profiler I don't see the stored procedure being called. Do I have
    to associate it with a control to be called?

    Do I set the values for the labels in the _selected event? At this point, I
    can't get the _selected event for the sqldatasource to occur.
    Andy in South Jersey, Feb 11, 2009
    #1
    1. Advertising

  2. I am sorry this post is repeated four times, I kept on getting an error, I
    thought it wasn't getting posted.

    My apologies.

    "Andy in South Jersey" wrote:

    > I have a sqldatasource control that has SelectCommand set to StoredProcedure,
    > and that stored procedure only returns OUTPUT parameters, it doesn't return a
    > recordset. It has one INPUT parameter. I would like to set the OUTPUT
    > values that are returned by the SP to the text value of labels that I have on
    > my page.
    >
    > When I configure the datasource I set the Direction to Output, I then
    > "Finish" and when I go back to the configuration it says InputOutput, but the
    > source code says:
    >
    > <asp:parameter Direction="Output" Name="weight" Type="Int32" />
    >
    > So, that was an initial concern, but I don't think that's the problem.
    >
    > Via SQL Profiler I don't see the stored procedure being called. Do I have
    > to associate it with a control to be called?
    >
    > Do I set the values for the labels in the _selected event? At this point, I
    > can't get the _selected event for the sqldatasource to occur.
    >
    >
    >
    >
    >
    >
    >
    >
    Andy in South Jersey, Feb 11, 2009
    #2
    1. Advertising

  3. RE: sqldatasource using a stored procedure with OUTPUT parameters

    In the code for the sqldatasource I do have:

    OnSelected="DataSource1_Selected"


    "Andy in South Jersey" wrote:

    > I am sorry this post is repeated four times, I kept on getting an error, I
    > thought it wasn't getting posted.
    >
    > My apologies.
    >
    > "Andy in South Jersey" wrote:
    >
    > > I have a sqldatasource control that has SelectCommand set to StoredProcedure,
    > > and that stored procedure only returns OUTPUT parameters, it doesn't return a
    > > recordset. It has one INPUT parameter. I would like to set the OUTPUT
    > > values that are returned by the SP to the text value of labels that I have on
    > > my page.
    > >
    > > When I configure the datasource I set the Direction to Output, I then
    > > "Finish" and when I go back to the configuration it says InputOutput, but the
    > > source code says:
    > >
    > > <asp:parameter Direction="Output" Name="weight" Type="Int32" />
    > >
    > > So, that was an initial concern, but I don't think that's the problem.
    > >
    > > Via SQL Profiler I don't see the stored procedure being called. Do I have
    > > to associate it with a control to be called?
    > >
    > > Do I set the values for the labels in the _selected event? At this point, I
    > > can't get the _selected event for the sqldatasource to occur.
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    Andy in South Jersey, Feb 11, 2009
    #3
  4. RE: sqldatasource using a stored procedure with OUTPUT parameters

    I have set the default value for the single input parameter to a DefaultValue
    (ie a string) I did this when I configured the Data Source.

    So, I don't see any need to change

    CancelSelectOnNullParameter

    This must have something to do with the INPUT parameter.

    "Andy in South Jersey" wrote:

    > In the code for the sqldatasource I do have:
    >
    > OnSelected="DataSource1_Selected"
    >
    >
    > "Andy in South Jersey" wrote:
    >
    > > I am sorry this post is repeated four times, I kept on getting an error, I
    > > thought it wasn't getting posted.
    > >
    > > My apologies.
    > >
    > > "Andy in South Jersey" wrote:
    > >
    > > > I have a sqldatasource control that has SelectCommand set to StoredProcedure,
    > > > and that stored procedure only returns OUTPUT parameters, it doesn't return a
    > > > recordset. It has one INPUT parameter. I would like to set the OUTPUT
    > > > values that are returned by the SP to the text value of labels that I have on
    > > > my page.
    > > >
    > > > When I configure the datasource I set the Direction to Output, I then
    > > > "Finish" and when I go back to the configuration it says InputOutput, but the
    > > > source code says:
    > > >
    > > > <asp:parameter Direction="Output" Name="weight" Type="Int32" />
    > > >
    > > > So, that was an initial concern, but I don't think that's the problem.
    > > >
    > > > Via SQL Profiler I don't see the stored procedure being called. Do I have
    > > > to associate it with a control to be called?
    > > >
    > > > Do I set the values for the labels in the _selected event? At this point, I
    > > > can't get the _selected event for the sqldatasource to occur.
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    Andy in South Jersey, Feb 11, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. michelle
    Replies:
    3
    Views:
    7,057
    Tapio Kulmala
    Feb 14, 2006
  2. Andy in South Jersey
    Replies:
    0
    Views:
    282
    Andy in South Jersey
    Feb 11, 2009
  3. Andy in South Jersey
    Replies:
    0
    Views:
    328
    Andy in South Jersey
    Feb 11, 2009
  4. Andy in South Jersey
    Replies:
    0
    Views:
    257
    Andy in South Jersey
    Feb 11, 2009
  5. Scott.Metzger
    Replies:
    4
    Views:
    1,038
    Alexey Smirnov
    Oct 6, 2009
Loading...

Share This Page