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 VatsaPosted May 12, 2011, 4:07 AM
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
fawzan mohamedPosted May 12, 2011, 1:53 AM
fawzan mohamedPosted May 12, 2011, 1:53 AM
Abhimanyu K VatsaPosted May 12, 2011, 1:33 AM
Cheers!!