执行读取器和SQL数据适配器之间的区别 [英] difference between execute reader and sql data adapter

查看:123
本文介绍了执行读取器和SQL数据适配器之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家

我知道功能和存储过程的区别。我们可以在商店程序中调用函数但是不能在函数中调用存储过程....



我的问题是为什么我们不能在函数中调用存储过程。以及执行阅读器和SQL数据适配器之间的区别

hi experts
I know the difference of function and store procedure.We can call function in store procedure but can't call store procedure in function ....

My question is Why we can't call store procedure in function. and also the difference between execute reader and sql data adapter

推荐答案

ExcuteReader



ExecuteReader返回datareader。 DataReader 用于从数据库读取数据,在从数据库中获取数据时,它是一个只读和转发的面向连接的体系结构。 >


DataAdapter

DataAdapter 将充当两者之间的桥梁DataSet和数据库。此dataadapter对象用于从数据库中读取数据并将该数据绑定到数据集。



查看此链接的更多信息



http://www.aspdotnet-suresh.com/2012 /10/aspnet-difference-between-datareader.html [ ^ ]
ExcuteReader

ExecuteReader returns datareader. DataReader is used to read the data from database and it is a read and forward only connection oriented architecture during fetch the data from database.

DataAdapter
DataAdapter will acts as a Bridge between DataSet and database. This dataadapter object is used to read the data from database and bind that data to dataset.

Check more on this link

http://www.aspdotnet-suresh.com/2012/10/aspnet-difference-between-datareader.html[^]


1。为什么我们不能在函数中调用存储过程?

这是一个如何从函数调用SP的简单技巧: http://www.dotnetfunda.com/forums/thread8955-how-can-call-stored -procedure-inside-function-in-sql-server-2005.aspx [ ^ ]



2。以及执行阅读器和SQL数据适配器之间的区别

请不要偷懒。阅读:

http:// msdn。 microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx [ ^ ]

http://msdn.microsoft.com/en-US/library/system.data.sqlclient.sqldataadapter.aspx [ ^ ]
1. Why we can't call store procedure in function?
Here is a simple trick how to call SP from function: http://www.dotnetfunda.com/forums/thread8955-how-can-call-stored-procedure-inside-function-in-sql-server-2005.aspx[^]

2. and also the difference between execute reader and sql data adapter
Please, don't be lazy. Read about it:
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.aspx[^]
http://msdn.microsoft.com/en-US/library/system.data.sqlclient.sqldataadapter.aspx[^]


这篇关于执行读取器和SQL数据适配器之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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