public List<string[]> SetList(DataTable dt)
{
List<string[]> list = new List<string[]>();
foreach (DataRow r in dt.Rows)
{
int colCount = r.ItemArray.Count();
string[] items = new string[colCount];
for (int i = 0; i < colCount; i++)
{
items[i] = Convert.ToString(r.ItemArray[i]);
}
list.Add(items);
}
return list;
}
相关文章
- Mybatis 查询TypeHandler使用,转译查询数据(逗号分隔转List)
- 如何将Excel的一种表格式转换为另一种格式(多行转一行)
- (转)无法将类型为“Microsoft.Office.Interop.Word.ApplicationClass”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Word._Application”。此操作失败的原因是对 IID 为“{00020970-
- java中Map,List与Set的区别(转)
- DataRow数组 转 datatable
- 项目中常用方法总结(将将DataTable数据集映射到实体对象)【转】
- [转][C#]c# 将JSON转化为list实体类,将list实体类转化为JSON字符串
- Postman传递Json字符串型数组转List,并存入父类的List属性中
- list对象转json
- 将8421BCD码转换为十进制数(转)