Hi rhino000,
If you want to check any value any column or any condition so there is always possibility to check condition by code. It may be if, switch or turnery operator without of this you cannot assume that it will work like flying code.
You can refer below code for satisfying you requirement
string Item = GetValue(drr, "Item_Code");
public string GetValue(IDataReader idr, string columnName)
{
string returnValue = string.Empty;
try
{
returnValue = idr[columnName].ToString();
}
catch
{
returnValue = "NULL";
}
return returnValue;
}