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
What is ado net stands for?
How does ado.net work?
Which database is the ado.net sql connection object designed for?
Explain how do you connect to sql server database without using sqlclient?
What is ado.net objects?
describe the dataset object in ado.net.
What are two types of transaction supported by ado.net?
Where is adodb dll located?
Is ado.net an orm?
What is the difference between executenonquery () and executescalar ()?
Explain which name space is used to get assembly details?
What is ole db query?
what is the difference betwen typed dataset and untyped dataset?in general which dataset can we use in programming?
How to retrieve the user id which is provided while windows authentication?
What is the role of clr?