Answer Posted / manish t
the command in the above code uses cmd.executereader ()
which means an datareader object is returned as a result of
the execution .....which essentially means one datar reader
object getting assigned to another datareader object
dr = cmd.executereader
so it is simply assigning of objects and does not require
new keyword as the datareader inside the execute reader has
already allocated space and it is just assigning it to a
different object ...this is true with executedataset as
well ...remember the rule is that corret type should be
returned. it is same in case of any objects ..try creating
an object A with new keyword and another object B of same
type without new key word ...and then assign the A to B and
you will find that By ref all properties are avialable to b
Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
Which keyword is used to accept variable number of parameters?
What is the difference between sqldatareader and sqldataadapter?
What is DataRowCollection?
What are the benefits of using ado.net?
How many major types of connection objects in ADO.NET?
describe the dataset object in ado.net.
What is openquery?
What is commandbuilder in ado.net?
What are the main differences between classic ado and ado.net?
What is ado circle?
What is microsoft ado?
What is the difference between data reader and data adapter?
What is datasource in ado.net?
Is datareader faster than datatable?
What is difference between ado.net and asp net?