You need to wrap it up in a parser.
If you change to code to be
Decimal.Parse(txtrate_km.Text)
Then you should achieve what you are after.
The problem is caused because the Parameter object does not know how to convert from one type to another.
In order to handle the null value you could put something like this in place:
txtrate_km.Text.IsNullOrEmpty() ? DBnull.value : Decimal.Parse(txtrate_km.Text)
What this will do is check if the text box is empty/null and send the correct dbnull value, else it will try and parse the entered text and send that decimal value.
I would also add validation code to ensure only numbers have been entered into the text box.