stored procedure in VB binding source?

J

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
 
A

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>


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
 
J

Joe Befumo

thanks a bunch -- I'll give that a try.

Joe
"Alexey Smirnov" <removeit.hello_at_smalig.com> wrote in message
<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>


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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top