从IDataReader到SQL的Linq [英] Linq to sql from a IDataReader

查看:83
本文介绍了从IDataReader到SQL的Linq的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我需要将通用IDataReader转换为Linq to SQL对象...

Hi all, i need to transform a generic IDataReader into an Linq to SQL object...

我已经看到了很多示例,从linq到sql到IDatareader,但是并没有相反的方式...

i've seen many examples from a linq to sql to IDatareader, but nothing int the opposite way...

有一种方法可以做到这一点,还是我要问一个未实现/不可能的事情?

there is a method to do that thing, or i'm asking a not implemented / impossible thing?

谢谢大家的答复.

Davide(大个子)

Davide (the big one)

推荐答案

Linq是用于实现IEnumerable接口的那些对象的一组扩展方法.因此...要实现您想要的目标,您将需要IDataReader对象来合并IEnumerable List.然后,您可以使用Linq.

Linq is a set of extension methods for those objects that implement the IEnumerable Interface. So...to achieve what you want, you would need you IDataReader object to hydrate an IEnumerable List. Then, you could use Linq.

 

John


这篇关于从IDataReader到SQL的Linq的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆