ExecuteReader, ExecuteNonQuery and Executescalar in ADO.NET

In this post I will explain about what is ExecuteReader, ExecuteNonQuery and Executescalar in ADO.NET.

(1)ExecuteNonQuery

ExecuteNonQuery method is used to execute DML SQL Command like INSERT, UPDATE or Delete operations. It will not return any data from the database. Instead, it returns an integer specifying the number of rows inserted, updated or deleted.

(2)ExecuteReader

ExecuteReader method is used to execute a SQL Command or StoredProcedure, It returns a set of rows from the database,It it used with select query.

(3)Executescalar

ExecuteScalar method is used to execute SQL Commands or StoreProcedure, This method return a single value from the database. It also returns the first column of the first row in the result set from a database.

Summary

You can also read about ASP.NET, JQuery, JSON, C#.Net
I hope you get an idea about ExecuteReader, ExecuteNonQuery and Executescalar in ADO.NET.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you liked this post, don’t forget to share this.