D
David C
I am troubleshooting a SQLDataSource tied to a stored procedure to return
records in a GridView. The stored procedure is setup to return matches on
either a SSN or a name. When I enter a name I get results, but when I enter
a SSN it returns nothing. Below are the 2 parameters linked to the 2
TextBox controls. When I run the stored procedure from SSMS, and enter only
the SSN I get results back fine. The stored proc requires a NULL in the name
if the SSN is entered. Can anyone help on this? Thanks.
David
<asp:SqlDataSource ID="SqlPeopleSearch" runat="server"
ConnectionString="<%$ ConnectionStrings:MCFICoreConnectionString %>"
SelectCommand="mc_selPeopleSearchNew"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="txtFindSSN" Name="SSN"
PropertyName="Text" Type="Int32" DefaultValue="0" />
<asp:ControlParameter ControlID="txtFindName" Name="SearchText"
PropertyName="Text"
Type="String" DefaultValue=""
ConvertEmptyStringToNull="true" />
</SelectParameters>
</asp:SqlDataSource>
records in a GridView. The stored procedure is setup to return matches on
either a SSN or a name. When I enter a name I get results, but when I enter
a SSN it returns nothing. Below are the 2 parameters linked to the 2
TextBox controls. When I run the stored procedure from SSMS, and enter only
the SSN I get results back fine. The stored proc requires a NULL in the name
if the SSN is entered. Can anyone help on this? Thanks.
David
<asp:SqlDataSource ID="SqlPeopleSearch" runat="server"
ConnectionString="<%$ ConnectionStrings:MCFICoreConnectionString %>"
SelectCommand="mc_selPeopleSearchNew"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="txtFindSSN" Name="SSN"
PropertyName="Text" Type="Int32" DefaultValue="0" />
<asp:ControlParameter ControlID="txtFindName" Name="SearchText"
PropertyName="Text"
Type="String" DefaultValue=""
ConvertEmptyStringToNull="true" />
</SelectParameters>
</asp:SqlDataSource>