On your DataSource, use ControlParam for the DefaultValue parameter:
<asp:ControlParameter Name="CustomerID"
ControlID="DropDownList1" PropertyName="SelectedValue"
DefaultValue="-1" />
Then in your SQL query, check this default value from your ControlParameter:
SELECT *
FROM Invoices
WHERE (CustomerID = @CustomerID OR @CustomerID = -1)
source
share