When adding to a parameter collection in .NET C# using SqlParamaterCollection.Add
, an overloaded method determines the size of the parameter.
Another overloaded method does not include the size of the parameter, but the example of its use shows the size being set immediately after the method is used.
In both cases, the documentation doesn't specify how to max the parameter size a "MAX" value. For example, as when inserting into a column of type NVARCHAR(MAX)
.
How should this be done?
// ? below indicates confusion on how to make this MAX.
// it only takes type "int"
var parameter = new SqlParameter("@param1", SqlDbType.NVarChar, ?);
command.Parameters.Add(parameter);