三、 将DataTable 转换为List
生活随笔
收集整理的這篇文章主要介紹了
三、 将DataTable 转换为List
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. 方法
public static IList<T> ConvertTo<T>(DataTable table)
{
if (table == null)
{
return null;
}
List<DataRow> rows = new List<DataRow>();
foreach (DataRow row in table.Rows)
{
rows.Add(row);
}
return ConvertTo<T>(rows);
}
2. 調用方法
DataTable dt= ExceStoredProcedure("NewPage", param)
IList<T> list = Common.ConvertTo<T>( dt);
轉載于:https://www.cnblogs.com/joe9976/p/5917143.html
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的三、 将DataTable 转换为List的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微软Team Foundation Se
- 下一篇: css控制页面文字不能被选中user-s