I am trying to pull data from a database with a stored procedure that takes an integer for the parameter. I used the video http://tv.telerik.com/reporting/video/telerik-reporting-+-design-time-support-for-parameterized-queries as a guide but cannot get the report to work properly.
If I put a value in the Collection Editor for the parameter, I get data returned, but only for the parameter that is hard coded. If I remove that value, I get an error saying 'Failed to convert parameter value from a String to a Int32.
Here is the code for my button. I have created the getter/setter on my ReportViewer object for the parameter OrderIDParam as per the video's instructions. I ran it through debug and the value being passed to the setter is correct.
If I put a value in the Collection Editor for the parameter, I get data returned, but only for the parameter that is hard coded. If I remove that value, I get an error saying 'Failed to convert parameter value from a String to a Int32.
Here is the code for my button. I have created the getter/setter on my ReportViewer object for the parameter OrderIDParam as per the video's instructions. I ran it through debug and the value being passed to the setter is correct.
protected void btnRun_Click(object sender, EventArgs e)
{
(ReportViewer1.Report
as ReportViewer).OrderIDParam = int.Parse(txtOrderID.Text);
ReportViewer1.RefreshReport();
}
Any help would be appreciated. Thanks.