ExecuteReader() in ADO.NET using asp.net with Example

In our previous article we have discussed ExecuteNonQuery() and ExecuteScalar() methods with examples. All three methods are part of SQL Command Class. You can visit ExecuteNonQuery() with Example in Asp.net and ExecuteScalar() with Example in Asp.net for more details. In this article we comes with ExecuteReader() with example code.

ExecuteReader()
ExecuteReader() method will return set of row on execution of SQL Statement.When SQLCommand SQLCommand.ExecuteReader() execute it will initialize SQLDataReader object.SQLDataReader is forwardonly and readonly.