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
differance between ADO vs ADO.Net?
What are the drawbacks of using ado.net?
Explain the difference in record set and dataset?
What is disconnected data?
Explain the various objects in dataset.
What is dbcontext and dbset in entity framework?
What are the benefits of using ado.net?
What is ole in vb?
Which object needs to be closed?
What are datareaders?
What is ole2 format?
What is linq and entity framework?
Which is the best method to get two values from the database?
What is dataset and datatable in ado.net?
What is the difference between OLEDB Provider and SqlClient?