Home All Groups Group Topic Archive Search About

stored procedure in VB binding source?

Author
2 Apr 2006 4:15 PM
Joe Befumo
I'm using a datagrid, and have it get its data from a stored procedure. I've set up a table adaptor and related binding source pointing to my stored procedure, but can't figure out how to pass a parameter to the SP through the binding source.  (I know I could do it by setting up connection and command objects, building the"Execute" sql string, etc., but I'm already using that grid to get data from a query using the binding source, and would like to be consistent.)  Thanks.

Joe

Author
2 Apr 2006 9:15 PM
Alexey Smirnov
<asp:SqlDataSource
          id="SqlDataSource1"
          runat="server"
          DataSourceMode="DataReader"
          ConnectionString="......."
          SelectCommand="MyProc param1, param2">
      </asp:SqlDataSource>

      <asp:GridView
          id="GridView1"
          runat="server"
          DataSourceID="SqlDataSource1">
      </asp:GridView>


  "Joe Befumo" <j**@befumo.com> wrote in message news:442ff8a2$0$18112$b9f67a60@news.newsdemon.com...
  I'm using a datagrid, and have it get its data from a stored procedure. I've set up a table adaptor and related binding source pointing to my stored procedure, but can't figure out how to pass a parameter to the SP through the binding source.  (I know I could do it by setting up connection and command objects, building the"Execute" sql string, etc., but I'm already using that grid to get data from a query using the binding source, and would like to be consistent.)  Thanks.

  Joe
Author
3 Apr 2006 11:18 AM
Joe Befumo
thanks a bunch -- I'll give that a try.

Joe
  "Alexey Smirnov" <removeit.hello_at_smalig.com> wrote in message news:OFk8lqpVGHA.4960@TK2MSFTNGP12.phx.gbl...

        <asp:SqlDataSource
            id="SqlDataSource1"
            runat="server"
            DataSourceMode="DataReader"
            ConnectionString="......."
            SelectCommand="MyProc param1, param2">
        </asp:SqlDataSource>

        <asp:GridView
            id="GridView1"
            runat="server"
            DataSourceID="SqlDataSource1">
        </asp:GridView>


"Joe Befumo" <j**@befumo.com> wrote in message news:442ff8a2$0$18112$b9f67a60@news.newsdemon.com...
    I'm using a datagrid, and have it get its data from a stored procedure. I've set up a table adaptor and related binding source pointing to my stored procedure, but can't figure out how to pass a parameter to the SP through the binding source.  (I know I could do it by setting up connection and command objects, building the"Execute" sql string, etc., but I'm already using that grid to get data from a query using the binding source, and would like to be consistent.)  Thanks.

    Joe