Reputation: 43788
I have the following code:
<asp:SqlDataSource ID="dsLeave"
runat="server"
ConnectionString="<%$ ConnectionStrings:test %>"
SelectCommand="app_leave_notification_select"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="employee_id" Type="int32" />
</SelectParameters>
</asp:SqlDataSource>
Does anyone know how can I pass null into asp:Parameter employee_id?
Upvotes: 1
Views: 1588
Reputation: 1335
Add a ConvertEmptyStringToNull="true"
into the Parameter so it would like like:
<asp:Parameter Name="employee_id"
Type="int32"
ConvertEmptyStringToNull="true" />
Add pass in an empty string.
I got this from this blog entry: http://www.blog.sumantdubey.com/post/SQLDataSource-Passing-Null-Parameters.aspx
Upvotes: 3
Reputation: 19
<asp:Parameter Name="employee_id"
Type="Int32?"
ConvertEmptyStringToNull="true" />
Upvotes: 1