Linq to sql convert IQueryable to Dataset

前端 未结 4 516
谎友^
谎友^ 2021-01-06 11:48

What is the easiest way to convert an IQueryable object to a dataset?

4条回答
  •  星月不相逢
    2021-01-06 12:11

    The easiest thing to do might be to write an implementation of IDataReader that can wrapper an IEnumerable (IQueryable is an IEnumberable). There is an implementation here. Then you can call DataTable.Load(IDataReader).

提交回复
热议问题