I'm trying to pass a parameter into a stored proc using ADO.NET. This paramater is of type int but the field in the database is nullable. Here's my code:
AddInParameter(cmd, "@i_Required_License_List_PKID", DbType.Int32, RequiredLicenseListPkid==""? null : Convert.ToInt32(RequiredLicenseListPkid);
When I do this I get an error saying that there's no conversion between null and int.
I have also tried DbNull.Value in place of null but with the same result.
I can't seem to find any nullable parameter types in the DbType class but I wonder is that the solution.