Differents between ExecuteReader, ExecuteNonQuery & ExecuteScalar

ExecuteReader : Use for accessing data. It provides a forward-only, read-only, connected recordset.

ExecuteNonQuery : Use for data manipulation, such as Insert, Update, Delete.

ExecuteScalar : Use for retriving 1 row 1 col. value.,
i.e. Single value.
eg: for retriving aggregate function.
It is faster than other ways of retriving a single value from DB.

Comments

Popular posts from this blog

Page Life Cycle in ASP.NET

ASP.NET MVC: Benefits

Auto Refresh .aspx page - ASP.NET

MVC Request Execution Stages - Life Cycle

Parsing the comma separated values into a temporary table

Introduction to ASP.Net MVC

SOLID Principles with C#

SQL Server 2005 with XML Parameters

How to Update Dependent Excel Cells Automatically