4
Answers

null/empty value problem

Shovan Saha

Shovan Saha

7y
209
1
For any null/empty value this code does not work. Please help me.
 
string TotalQty = (Convert.ToInt32(_product.Where(x => x.Type.ToLower() == row.Cells[0].Value.ToString().ToLower()).Select(x => x.TotalQty).FirstOrDefault()) + Convert.ToInt32(row.Cells[3].Value.ToString())).ToString(); 
Answers (4)