Introduction:
In this article I will explain differences between executereader, executenonquery and executescalar in asp.net.
Description:
In
previous posts I explained difference between Len and DataLength functions, difference between int,tinyint and
bigint
and differences between char, varchar and
nvarchar
in SQL
Server.
Now I will explain difference between executereader, executenonquery and
executescalar in asp.net
ExecuteNonQuery
ExecuteNonQuery
method will return number of rows effected with INSERT, DELETE or UPDATE
operations.
This ExecuteNonQuery method will be used only for insert, update and delete, Create, and SET statements. (Read More)
ExecuteScalar
Execute
Scalar will return single row single column value i.e. single value, on
execution of SQL Query or Stored procedure using command object. It’s very fast
to retrieve single values from database. (Read More)
ExecuteReader
Execute
Reader will be used to return the set of rows, on execution of SQL Query or
Stored procedure using command object. This one is forward only retrieval of
records and it is used to read the table values from first to last. (Read More)
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
23 comments :
its very useful.....
thanks
thankssssss
its very useful
Sir this is Ravi can you please help me for this
how to find SMTP SERVER IP FOR MY SITE.USING MY SYSTEM.
EXE YOUR sSmtpServer = "10.2.69.121" .
SEND TO MY MAIL ID:ravidotnetsite@gmail.com
@Ravi Chanti...
SMTP server means it's mail exchange server it will configure by network people.It's not possible to find the IP of smtpserver with your site or your system. If you host the site in any service provide ask them to provide smtp server address to send mails.
with very simple understanding....thanks bro.
Great and useful information.
provide how to write the code for preview using stored procedure
thanx
its useful friend thank you , can u provide with an example coding of the Three Methods (Execute Scalar,Execute NonQuery and Execute Reader).
I understand the executenonquery, really useful info.
very useful. thank you
very simple and understandable lag. good job
superb
excellent
You should have developed your page using asp...
simple and best explanation
Thanks !!
This info is most useful !
thanks.. nice explaiation
Thanks for giving info
very nice explaination
Note: Only a member of this blog may post a comment.