G
Guest
When I run the following code:
private string GetSystemPriorityRange()
{
decimal fromPriority = Convert.ToDecimal(systemPriorityFromList.SelectedItem);
decimal toPriority = Convert.ToDecimal(systemPriorityToList.SelectedItem);
if (systemPriorityRangeCheck.Checked == true)
{
return " and wo6 between " + "'" + fromPriority + "'" + " and " + "'" + toPriority + "'";
}
else
{
return null;
}
}
I get the following error:
Specified cast is not valid.
The values involved are things like 0, 1.00, 1.60, 2.50
Aren't these decimal types. How should I alter my code to handle this?
Thanks,
Dave
private string GetSystemPriorityRange()
{
decimal fromPriority = Convert.ToDecimal(systemPriorityFromList.SelectedItem);
decimal toPriority = Convert.ToDecimal(systemPriorityToList.SelectedItem);
if (systemPriorityRangeCheck.Checked == true)
{
return " and wo6 between " + "'" + fromPriority + "'" + " and " + "'" + toPriority + "'";
}
else
{
return null;
}
}
I get the following error:
Specified cast is not valid.
The values involved are things like 0, 1.00, 1.60, 2.50
Aren't these decimal types. How should I alter my code to handle this?
Thanks,
Dave