If CaseType always contains a character value then what is the need to declare it as int ?
Try your code using string data type
public static string GetNewInvestigationNumber(DateTime openedDate, string caseType)
{
Database db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("DL_NewInvestigationNumber");
db.AddInParameter(dbCommand, "OpenedDate", DbType.DateTime, openedDate);
db.AddInParameter(dbCommand, "CaseType", DbType.varchar, caseType );
return (string)db.ExecuteScalar(dbCommand);
}
private void GetNewInvestigationNumber()
{
int openedDate;
string caseType;
if (OpenedDate.Month >= 7)
openedDate = OpenedDate.Year + 1;
else
openedDate = OpenedDate.Year;
InvestigationNum = CaseInvestigationDB.GetNewInvestigationNumber(openedDate, caseType);
}