coudn't get value from text box : i have a text box called txtUprice.. which gets the value from a data grid view
**but when i tried get value of txtUprice text box in a message box.. (with or without changing the text box value)  im getting an error "Input string was not in a correct format"** 

i have tried changing the data type in sql  where i get the value to the datagrid

//to get value for textbox from data grid i have used this code

txtUprice.Text = datagridview.SelectedRows[0].Cells[4].Value.ToString()

//to take the textbox value to messagebox i have used this code

            int unitprice;
            unitprice = int.Parse(txtUprice.Text);
            MessageBox.Show(unitprice.ToString());