从DataTable中删除不被控件支持的字段类型

DataTable dt = DB.GetDataTable(sql);
           
            //从dt中删除不被控件支持的字段类型
            for (int i = 0; i < dt.Columns.Count; i++)
            {
                Type tp=dt.Columns[i].DataType;
                if (tp == typeof(Byte[]))
                {
                    dt.Columns.RemoveAt(i);
                    i--;
                }
            }
           
            DB.DvBind(dvContent, dt, 1, true);

posted on 2019-06-12 15:47  mol1995  阅读(122)  评论(0编辑  收藏  举报

导航