4
Reply

null/empty value problem

Shovan Saha

Shovan Saha

Sep 17 2017 12:47 PM
190
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)