博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C#: 为datatable添加column的方法

Posted on 2006-09-23 09:50  Kent  阅读(1216)  评论(0)    收藏  举报
    if(!ds.Tables[0].Columns.Contains("WithHoldingTaxBase_Amt"))
    {
     ds.Tables[0].Columns.Add("WithHoldingTaxBase_Amt",Type.GetType("System.Decimal"));
    }
    if(!ds.Tables[0].Columns.Contains("WithHoldingTax_Type"))
    {
     ds.Tables[0].Columns.Add("WithHoldingTax_Type",Type.GetType("System.String"));
    }