I need to update dataset table adapter in Visual Studio 2010. It is based on a stored procedure. The store procedure has parameters
@IDportfolio INT
, @Date varchar(50) = NULL
, @IDorder int = NULL
, @IDsession nvarchar(300) = NULL
, @User varchar(100) = NULL
, @UDNsXML NVARCHAR(MAX) = NULL
, @DEBUG INT = 0
The table adapter had this methods:
Fill,GetData (@IDportfolio, @Date, @IDorder, @IDsession, @User, @UDN)
So I needed to refresh it. In the procedure there is one IF statement that gets executed only if @DEBUG is set to 1. Inside this IF statement there are some SELECT statements used for internal debugging. Value 1 is obviously not default value as can be seen in the signature, yet designer, when refreshing the methods, acts like it is sending value 1 for @DEBUG parameter. So instead of returning values that should be returned, it returns wrong set of values, and designer tries to make methods based on these returned values.
Why is designer working like that and is there some default value for INT parameters, or is he ignoring default values? I have noticed similar behavior in Entity Framework too.