Hi,
I think you should make a function to trapped said error:
Example:
public static string IifStr(object p)
{
string retVal = string.Empty;
if (p != DBNull.Value || p != null)
{
retVal = Convert.ToString(p);
}
return retVal;
}
public static string IifStr(string p)
{
string retVal = string.Empty;
if (!string.IsNullOrEmpty(p))
{
retVal = Convert.ToString(p);
}
return retVal;
}
IEnumerable<DataRow> dtRow = exDT.AsEnumerable();
var lstExcelData = dtRow.Select(s => new Claim
{
Remarks = IifStr(s.Field<string>("REMARKS")),
ClaimType = IifStr(s.Field<string>("TRANSTYPE"))
}).ToList();
Hope this could help...
Regards,