2 commented lines give errors..plz help me to correct it...im a biginner...
if (reader.Read())
if (reader.Read())
{
BE.InterestRate objir = new BE.InterestRate();
//objir.percentage = reader.GetFloat(Convert.ToString("percentage"));
//objir.percentage =float.Parse(Convert.ToString(reader.GetOrdinal("percentage")));
objir.Interest_Id = reader.GetInt32(reader.GetOrdinal("Interest_Id"));
objIR.Add(objir);
}
VulpesPosted Apr 13, 2011, 6:17 AM
Incidentally, if the column could be null, it might be a good idea to check for that before reading any more values:
Tharake GunatilakePosted Apr 13, 2011, 6:44 AM
Tharake GunatilakePosted Apr 13, 2011, 6:07 AM
I have no words to thank you....Good luck..
I'm a sri lankan and tomorrow is our new year day...
Wish you a happy new year....
VulpesPosted Apr 13, 2011, 5:39 AM
I'd test this hypothesis with:
objir.percentage = (float)reader.GetDouble(reader.GetOrdinal("percentage"));
Tharake GunatilakePosted Apr 13, 2011, 5:29 AM
2.this is the BE.InterestRate class
VulpesPosted Apr 13, 2011, 5:17 AM
1. The "percentage" column in the database; and
2. The objir.percentage property.
Is there any chance that the column could contain null values?
Tharake GunatilakePosted Apr 13, 2011, 5:14 AM
following one works...
objir.Interest_Id = reader.GetInt32(reader.GetOrdinal("Interest_Id"));
I want to get the percentage....Plz help me....
VulpesPosted Apr 13, 2011, 5:03 AM