mikecou
|
Posted: 01/06/2004, 12:25 PM |
|
I am grying to execute a stored procedure in code charge studio when my page loads. I call the proc and supply two dates to it
usp_report0011 '10/18/2003', '11/10/2003'
I would like to execute this code and possibly have the dates as variables pulled from the querystring. I cannot figure an easy way to do this. I am converting my site from codecharge to studio so I don't have all the studio code memorized yet and am not totally familiar with it. Any help would be appreciated.
thanks
mike
|
|
|
Edd
Posts: 547
|
Posted: 01/06/2004, 1:34 PM |
|
mike,
There are a number of ways you can do this.
1. On the "BeforeBuildSelect" Event you can change the Parameter (in this case MyDate) the following way - Note CCS prefixes URL variables with "url".
----------------------------------------------
If IsEmpty(Request.QueryString("MyDate") Then
LocalMyDate = Date
MyGrid.DataSource.Parameters("urlMyDate") = LocalMyDate
End If
2.You can set default parameters in the parameter section by entering a fixed value OR as I often do calling a function which returns the value.
3. If you are using Microsoft SQL you can pass a null and let the stored procedure take the default.
Hope this helps.
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
|
|
mikecou
|
Posted: 01/07/2004, 7:25 AM |
|
Thanks for the help but I am not looking for a way to pass the variables but a way to execute the stored procedure. There is no way that I can find to actually call a stored proc when the page loads. I just want to call it with a couple variables and let it do some of the work behind the scenes.
|
|
|
mikecou
|
Posted: 01/07/2004, 7:28 AM |
|
also if I have anything in the code for the stored proc that isn't a select, ccs says that it doesn't return a data set. any ideas on that as well?
|
|
|