获取read所有列


public static class h
{
public static List<string> GetFieldNames(this SqlDataReader dr)
{
var list = new List<string>();
for (var i = 0; i < dr.FieldCount; i++)
{
var name = dr.GetName(i);
list.Add(name);
}
return list;
}
}

posted on 2018-09-14 14:43  Smile向前  阅读(92)  评论(0编辑  收藏  举报