How to specify parameter value for stored procedure in SqlDataSource?

Up vote 0 down vote favorite 1 share g+ share fb share tw.

Being new to using the declarative syntax of SqlDataSource I am trying to figure out a way to set the value of a parameter to a stored procedure. I have a Client_ID that is passed via the Request Object and I need to set the Client_ID before the stored procedure of the SqlDataSource is executed. I have a couple of questions.

Does the stored procedure parameter have to be predefined in the ASPX markup or can it be added dynamically in the code-behind? Would anyone have an example that demonstrates the SqlDataSource markup with a stored procedure and parameter as well as setting that parameter value in code-behind? Asp.net stored-procedures parameters sqldatasource link|improve this question asked Mar 16 '11 at 13:37webworm933526 91% accept rate.

With .net 4 framework you can ... 1. It can be added dynamically, but you would have to provide your own code expression builder (for further info see here) 1.1 You can also use different parameter to achieve same goal, like : 2. " SelectCommand="YourStoreProcedure" SelectCommandType="StoredProcedure.

This is a fairly thorough example of using parameterized queries (Stored Procedure and Text) with SqlDataSource, including programmatically setting parameters. ASP. NET - Using Parameterized Queries with the SqlDataSource.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions