TabAlleman[^] wrote on ASP.NET Forums[^]:In the stored proc, give the nullable parameters a default value of NULL, and in your C# code, if no value is being passed to those parameters, simply don't attach them to your command.
MSDN[^] wrote: Specifying the Order of Parameters If you supply parameters in the form @parameter = value, you can supply them in any order. You can also omit parameters for which defaults have been supplied. If you supply one parameter in the form @parameter = value, you must supply all subsequent parameters this way. If you do not supply parameters in the form @parameter = value, you must supply them in the order given in the CREATE PROCEDURE statement. When executing a stored procedure, the server rejects any parameters that were not included with the parameter list during procedure creation. Any parameter passed by reference (explicitly passing the parameter name) is not accepted if the parameter name does not match.
tbl_Main tbl_Sub --------------------------------- Col1 --------> Col1 pk fk Not Allow null Allow Null
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)