This is a migrated thread and some comments may be shown as answers.

Getting error passing combo box value as parameter to stored procedure

2 Answers 140 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 01 Feb 2011, 04:50 PM
I am trying to filter a grid's data based on values selected in a combo box.  The combo box values are databound to a table and the grid is using a SQL Server stored procedure.  When I try to run the code I receive the following error:

ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or Function 'CRMDashboardSales' expects parameter '@CustBill', which was not supplied.

Why does SQL Server get this error when my SelectParameter is defined? 

Code for the grid's datasource:
<asp:SqlDataSource ID="gridsource2" runat="server"

    ConnectionString="<%$ ConnectionStrings:crmDashboardConnectionString %>"      ProviderName="<%$ ConnectionStrings:crmDashboardConnectionString.ProviderName %>"

 

 

 

     SelectCommand="CRMDashboardSales" SelectCommandType="StoredProcedure">

 

 

    <SelectParameters>

 

        <asp:ControlParameter ControlID="NamesDDL" Name="CustBill"

 

 

        PropertyName="SelectedValue" Type="String" />

 

    </SelectParameters>

 

</asp:SqlDataSource>

 

The combo box data value contains CustBill column and is specified as the parameter to send to the stored procedure.  I've also included the Ajax Manager code below for reference.  Thx.

<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"     
DefaultLoadingPanelID
="RadAjaxLoadingPanel1"> 
    <AjaxSettings>

 

 

    <telerik:AjaxSetting AjaxControlID="NamesDDL"> 
        <UpdatedControls
            <telerik:AjaxUpdatedControl ControlID="OrdersGrid" LoadingPanelID="AjaxLoadingPanel1" />

 

 

            <telerik:AjaxUpdatedControl ControlID="NamesDDL" />

 

 

        </UpdatedControls 

    </telerik:AjaxSetting
    </AjaxSettings>
</telerik:RadAjaxManager>

 

 

 

 

 

 

 

 



2 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 02 Feb 2011, 11:52 AM
Hello Scott,

Could you also paste here the definition of the RadComboBox and any code that is manipulating it on the server and the client?

Regards,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Scott
Top achievements
Rank 1
answered on 02 Feb 2011, 03:04 PM
I found the solution to this error.  Was using an ODBC connection instead of a direct SQL Server connection. Once I removed the ODBC and added the new SQL Server connection, I am able to pass parameters without error.  Thanks for your quick follow-up.
-Scott
Tags
General Discussions
Asked by
Scott
Top achievements
Rank 1
Answers by
Simon
Telerik team
Scott
Top achievements
Rank 1
Share this question
or