dataset的转换

  dataset _dataSource;
  IListSource ilistSource = _dataSource as IListSource;
  IList memberList = ilistSource.GetList();
//如果datasource 是dataTable此时得到一个dataview
//如果datasource是dataset此时返回
  if (!ilistSource.ContainsListCollection)
    {
        return (IEnumerable)ilistSource.GetList();//return dataview
    }
  然后分析得到dataset的多张表的属性集合
     IlistSoure  IListSoure.GetList()-->IList----
    -->ITypeList ITypeList.getItemProperty()--->PropertyDescriptorCollection(包含多张表的属性集合)

  单张表的属性集合    多张表的属性集合.Find(需要的表,true);
  可枚举的dataTable    单张表的属性集合.getValue(需要的表的数据)

posted @ 2007-11-15 21:04  老大卫  阅读(180)  评论(0编辑  收藏  举报