How to pass non-optional NULL parameters to a Stored Proc using OrmLite
问题 I'm using OrmLite against an existing SQL Server database that has published stored procedures for access. One of these SPs takes 3 int parameters, but expects that one or another will be null. However, none of the parameters are declared optional. Here's the code I've tried: using (IDbConnection scon = myFactory.OpenDbConnection()) { rowCount = scon.SqlScalar<int>("EXEC myProc @FileID, @FileTypeID, @POID", new { FileID = req.FileId, FileTypeID = (int?)null, POID = req.PoId, }); } But this