Difference between ExecuteNonQuery, ExecuteScalar and ExecuteReader
a) Used mainly for action queries(insert,delete,update,create,alter,drop).
It can also be used with select queries.
example: A stored procedure in SQL Server that can be used for autogeneration of ID's using its
output parameter can have the value of output parameter returned on a windows form using ExecuteNonQuery.
b)returns an int value indicating the number of affected rows
a)Used in queries where we have to read a single value
example: 1)select count(*) from emp
2) select ename from emp where eno=100
b)returns an object
b)Used in queries where we have to read a complete row of the data
example: select * from emp where eno=100
b)It initializes a SqlDataReader/OleDbDataReader variable which can then
be used to read the data returned.