如何在asp.net中返回DataReader [英] how to return DataReader in asp.net

查看:88
本文介绍了如何在asp.net中返回DataReader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人

我正在尝试使用方法返回数据读取器,但是当我在代码中调用此方法时,它已关闭,因此我无法读取它.
有什么解决办法吗?


请还原...

谢谢

Dear All

I am trying to return datareader using method .but its getting closed when i am calling this method in my code and because of this I cant read it.
Is there any solution for the same?


please revert...

Thanks

推荐答案

看这里:
使用DataReader(ADO.NET)检索数据 [ MSDN:ADO.NET [ MSDN:使用ADO.NET访问数据 [ ^ ]

C#Station ADO.NET教程 [为初学者使用ADO.NET [
Look here:
Retrieving Data Using a DataReader (ADO.NET)[^]

Read all about ADO.NET here:
MSDN: ADO.NET[^]
MSDN: Accessing Data with ADO.NET[^]

The C# Station ADO.NET Tutorial[^]
Using ADO.NET for beginners[^]


DataReader 不支持断开连接模式.一旦连接对象被关闭,DataReader 将被关闭.您可以使用DataTable 而不是DataReader 来支持断开连接模式.
DataReader does not support disconnected mode. Once the connection object is closed, DataReader will be closed. You can use DataTable instead of DataReader to support disconnected mode.


但是请将代码发送给我们,以便我们为您提供帮助
But send us the code,so that we can help you


这篇关于如何在asp.net中返回DataReader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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