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
How can we perform transactions in .net?
What is microsoft ado.net?
What is partial class?
What is data view and variable view?
What are the advantages and disadvantages of using datalist?
The answers which posted above is not satisfied my requirement? Can some one post teh exact answer? Thanx
What are all the commands used with Data Adapter?
What is ado.net connection?
What is aggregate root?
Explain what is datagrid with an example?
What is defaultview in datatable?
Explain the advantage of ADO.Net?
What is the significance of CommandBehavior.CloseConnection ?
Explain the difference between data reader and data set?
Define connection string?