DataTable

1.在原有的DataTable上添加一行

DataTable dt = (DataTable)cboSelectTemplate.DataSource;
DataRow dr = dt.NewRow();
dr["paraCName"] = paraCName;
dr["remark"] = JsonConvert.SerializeObject(info);
dt.Rows.Add(dr);

 

 2.DataTable转为数组

string[] arrRate = dtRate.AsEnumerable().Select(d => d.Field<string>("arry")).ToArray();

 

 3..DataTable转为集合

List<string> litRate = dtRate.AsEnumerable().Select(d => d.Field<string>("arry")).ToList();

posted @ 2019-11-05 07:46  风葬秋暝  阅读(195)  评论(0编辑  收藏  举报