Interview answers verified by specialists.

Find interview questions and answers on this website:

See right interview answers on 30 common job interview questions

Describe DataReader object of ADO.NET with example.

- The DataReader object is a forward-only and read only object 
- It is simple and fast compare to dataset. 
- It provides connection oriented environment. 
- It needs explicit open and close the connection. 
- DataReader object provides the read() method for reading the records. read() method returns Boolean type. 
- DataReader object cannot initialize directly, you must use ExecuteReader() method to initialize this object.


using System; 
using System.Web.UI; 
using System.Data; 
using System.Data.SqlClient; 
public partial class CareerRide : System.Web.UI.Page 
protected void Page_Load(object sender, EventArgs e)
if (!Page.IsPostBack) 
SqlDataReader reader; 
SqlConnection MyConnection = new SqlConnection("Data Source=name of your datasource;Initial Catalog=Employee;Integrated Security=True");
SqlCommand cmd = new SqlCommand(); 
cmd.CommandText = "SELECT * FROM emp"; 
cmd.CommandType = CommandType.Text; 
cmd.Connection = MyConnection; MyConnection.Open();
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection); 
GridView1.DataSource = reader; 

Do you know that?

$41 average hourly rates for Illustrator freelance Next


Getting payments for Freelancers
1. Read how to register and get earned money

2. Open account within 5 minPayoneer sing up to get free $25