I found a workaround for this error, but now I am very curious why this is happening, I was wondering if anyone else has this error.
My function is this:
public void Blog_GetRating(int blogID, ref decimal rating, ref int voteCount)
{
if (DataReader.Read())
{
rating = decimal.Parse(DataReader["Rating"].ToString());
decimal _rating = 0;
decimal.TryParse(DataReader["Rating"].ToString(), out _rating);
rating = _rating;
}
}
Has anyone ever seen this before?
What's even weirder if I type this:
rating = decimal.Parse("4.0");
which works fine, 4.0 is what comes out of my DataReader.
As I said before, the TryParse method works great, so it doesn’t stop me from porting, but now I’m really interested to know if anyone has an answer.
Looking forward to some answers!
Sean
EDIT - SOLVED
decimal.Parse , , ( ), , null. COALESCE SQL . , , , tryparse , 0 .