private void ReadComponentAndDBNames(ref int firstRow, ref int firstCol) { object compNameValue, compIdNameValue, linkValue; if ((compNameValue = range[firstRow, firstCol].Value) != null && (compIdNameValue = range[firstRow, firstCol + 1].Value) != null && (linkValue = range[firstRow, firstCol + 2].Value) != null) { string compName = compNameValue.ToString(); string compIdName = compIdNameValue.ToString(); string linkTo = linkValue.ToString(); if (compName.Length > 0 && compIdName.Length > 0) { if (!CompIdNameDict.ContainsKey(compName)) { CompIdNameDict.Add(compName, compIdName); } if (linkTo.Length > 0 && !DataLinksDict.ContainsKey(compName)) { DataLinksDict.Add(compName, linkTo); } } else { firstRow++; } } }