DataTable某一列转换为分隔字符串

//把DataTable的某一列转化为逗号分隔字符串
private static string DataTableColumnSplit(DataTable dataTable,string strColumn)
{
    int[] idInts = dataTable.AsEnumerable().Select(d => d.Field<int>(strColumn)).ToArray();
    return String.Join(",", idInts);
}

 

posted @ 2019-03-13 22:42  zhaogaojian  阅读(3032)  评论(0编辑  收藏  举报