1
Reply

When do you use ExecuteReader, ExecuteNonQuery, ExecuteScalar methods?

Partap Tanwar

Partap Tanwar

15y
8.8k
0
Reply

    ExecuteReader :- used for DDL queries and return a dataTable.used for SELECT queries and return the result in DataTable.


    ExecuteNonQuery:- Used for DML queries and return the no of row affected in integer
    Used for Insert, update and delete qeries.

    ExecuteScalar:- Used for executing Stored procedures.

    thanks
    http://yuvadeveloper.blogspot.com