Null Exception handling in foreach loop
问题 I am having the list X with some string and null value . I am iterating the foreach loop to bind the value to the textbox. If I get any null values in my list X the foreach loop get terminated and getting the null exception how to handle it. I am checking the condition inside the for each loop. but i tnink it not correct logcally. SPList _listObj = web.Lists[new Guid(listID)]; SPListItem item = _listObj.GetItemById(Convert.ToInt32(itemID)); foreach (SPField field in _listObj.Fields) { if