c# - text in textbox if in datagrid selection change is null -


enter image description here

how can command return empty space, if have in database null id , other space???

enter image description here

you need check if row.cells[18] null.

use inline operator ?:

var cotaid = (row.cells[18] == null) ? 0 : (int)row.cells[18].value; 

this "inline if statement" equal to

if(row.cells[18] == null)     cotaid = 0; else     cotaid = (int)row.cells[18].value; 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -