I suspect adding parameters to an SqlCommand does not return the value added. You would be better to convert your values into itemmastr then add the parameters from itemmastr. Also no need to convert to string what is already a string.
Cannot see the rest of your code for the decimal field you must also be certain that the data entered is a number, better to use decimal.tryparse to verify first and stop if it fails.
itemmastr.itemcode = txtitemcode.Text.Trim();
itemmastr.name = txtname.Text.Trim();
itemmastr.salesprice = Convert.ToDecimal(txtsaleprice.Text);
cmd.Parameters.AddWithValue("@itemcode", itemmastr.itemcode);
cmd.Parameters.AddWithValue("@name", itemmastr.name);
cmd.Parameters.AddWithValue("@salesprice", itemmastr.salesprice);
Forgot to add:
Your insert command does not include salesprice, it only inserts itemcode and name so you'll still get a failure on the cmd.parameters line for salesprice.