Header Ads

ExecuteReader VS ExecuteNonQuery VS ExecuteScalar

Difference between ExecuteReader,ExecuteNonQuery,ExecuteScalar

ExecuteReader :Use for accessing data.It provides a forward-only,read-only stream from database.

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.

No comments:


Powered by Blogger.