This is driving me nuts! I have had a sniplet of code that has been working for awhile but now it has stopped working and I can not figure out why. All I am trying to do is convert a TextBox value into a decimal so I can store it in my db. pretty simple right? I have the TextBox pre populated with a 0 so that a value can be passed if the user is not going to add any hours for this product. I feel like an idiot right now cuz I nothing I do seems to solve the problem.
string mh = manHoursTextBox.Text;
manHours = Convert.ToDecimal(mh);
It started throwing an error if no value was in the textbox, so I tried this:
if (string.IsNullOrEmpty(manHoursTextBox.Text) == false)
Session["mh"] = Decimal.Parse(manHoursTextBox.Text);