Whatz wrong with below code??? im getting 'sql exception was unhandled by user code' exception..
Why im am getting this??
public DataSet GetInterestData(DateTime dtSaleDate)
{
Database database = DatabaseFactory.CreateDatabase(CTBConnectionString);
DbConnection con = database.CreateConnection();
DbCommand command1 = database.GetStoredProcCommand("spGetInterestCalculationValue");
database.AddInParameter(command1, "@TransferDate", DbType.DateTime, dtSaleDate);
return database.ExecuteDataSet(command1);
}

Abhimanyu K VatsaRank #14 · 51.7K reputationPosted May 11, 2011, 9:33 PM EDT
Cheers!!
fawzan mohamed65 reputationPosted May 11, 2011, 9:53 PM EDT
fawzan mohamed65 reputationPosted May 11, 2011, 9:53 PM EDT
Abhimanyu K VatsaRank #14 · 51.7K reputationPosted May 12, 2011, 12:07 AM EDT
it will be perfect if you put breakpoints to track the error line. I think problem with the line
Navitiondatabase.AddInParameter(command1, "@TBoss_to_Intr_Date", DbType.Int32, dsInterestData.Tables[0].Rows[i]["TBoss_to_Intr_Date"].ToString());
Is this field 'Date', then you should use
Navitiondatabase.AddInParameter(command1, "@TBoss_to_Intr_Date", DbType.Date, dsInterestData.Tables[0].Rows[i]["TBoss_to_Intr_Date"].ToString());
Hope this helps