Is there a way to write the following script so that it returns all products if the ProductID variable is null ? And return a specific product when the product it is not nul
Since "" is not recognized as NULL I used value
NULL
SELECT ProductID, ProductName,ProductDesc FROM product WHERE ProductID =IIF(@productID =1, ProductID, @productID )
In my code:
MyDataAdapter.SelectCommand.Parameters("@productID").Value = 1