I've seen this question asked here before, but never when Enterprise Library is used. I've used code like the following before and it works fine. What's the problem this time? I get the error on the last line:
Database db = new SqlDatabase(MyConfiguration.Current.ConnectionString);
DbCommand cmd = db.GetStoredProcCommand("AddWorkListItem");
db.AddInParameter(cmd, "@PartNumber", DbType.String, partNumber);
db.AddInParameter(cmd, "@Quantity", DbType.Int32, qty);
db.AddInParameter(cmd, "@WorkListTypeCode", DbType.String, code);
db.AddInParameter(cmd, "@UserKey", DbType.Int32, userKey);
return cmd.ExecuteNonQuery();