Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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
Posted
Comments
Sergey Alexandrovich Kryukov 4-Jun-13 2:56am    
No, you don't know the "difference". Your questions are incorrect in principles. You are addressing concepts as it were formulas, without any aspects... It's not adequate thinking and lack of simple logic.
—SA

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[^]
 
Share this answer
 
v4
Comments
ErBhati 4-Jun-13 2:36am    
nice article by Suresh thanks for link....but what about S.P and function...
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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900