判断Table表中是否含有某一列

时间:2024-12-05 18:06:56

if (row.Table.Columns.Contains("DealRecord_GiftCost"))
{
     if (row["DealRecord_GiftCost"] != null && row["DealRecord_GiftCost"].ToString() != "")
     {
           model.DealRecord_GiftCost = decimal.Parse(row["DealRecord_GiftCost"].ToString());
     }
}