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

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());
     }
}

posted @ 2016-03-04 12:38  不想生命太空白、  阅读(1299)  评论(0编辑  收藏  举报