c# - Input String is not a correct format -


have been trying days now, want view recorded data update purpose double clicking on informations data grid view, meanwhile "input string not in correct format" error. code:

private void dgvgroundtech_double click(object sender, eventargs e){  if(dgvgroundtech.currentrow.index != -1) { id = convert.toint32(dgvgroundtech.currentrow.cells[0].tostring()); txtname.text = dgvgroundtech.currentrow.cells[1].tostrings();    txtitem.text = dgvgroundtech.currentrow.cells[2].tostrings();    txtmobilenumber.text = dgvgroundtech.currentrow.cells[3].tostrings();    cmbpurpose.text = dgvgroundtech.currentrow.cells[4].tostrings();    txtaddress.text = dgvgroundtech.currentrow.cells[5].tostrings();    txtamount.text = dgvgroundtech.currentrow.cells[6].tostrings();    txtdate.text = dgvgroundtech.currentrow.cells[7].tostrings(); } } 

this line potentially throw format exception.

id = convert.toint32(dgvgroundtech.currentrow.cells[0].tostring()); 

check values this

dgvgroundtech.currentrow.cells[0].tostring() 

do not fall category::

"value not consist of optional sign followed sequence of digits (0 through 9)."


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -