Overload

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

Hello. I'm pretty ignorant when it comes to asp.net but I'm working to
change that.

In another thread I was asking about using ReadXML to grab an ADO record set
I have in a string and make it usable. Eric offered a promising solution:

"The myDataSet.ReadXml method also has an overload that accepts an argument
derived from TextReader. Pass it a StringReader that wraps around the string
containing the XML you want to load and you're all set."

My problem is I'm at a total loss as to how I could implement such a thing.
Can anyone point me to an example or explain what's being brought up here?
Thanks!
 
MattB said:
Hello. I'm pretty ignorant when it comes to asp.net but I'm working to
change that.

In another thread I was asking about using ReadXML to grab an ADO record set
I have in a string and make it usable. Eric offered a promising solution:

"The myDataSet.ReadXml method also has an overload that accepts an argument
derived from TextReader. Pass it a StringReader that wraps around the string
containing the XML you want to load and you're all set."

My problem is I'm at a total loss as to how I could implement such a thing.
Can anyone point me to an example or explain what's being brought up here?
Thanks!

Is it that you don't understand the meaning of overload? If so, overloaded
methods are methods of the same name that have different signatures. Which
means they differ in the set of argument types they expect. So I could have:

foo()
foo(String val)
foo(String val, String val2)
foo(String val, Int32 val)

All of which are overloads of each other (they're all called foo). Think of it
as giving you different ways of doing something using different sets of inputs.

Otherwise, the answer is pretty much given in the other response to your question.
 
Craig said:
Is it that you don't understand the meaning of overload? If so,
overloaded methods are methods of the same name that have different
signatures. Which
means they differ in the set of argument types they expect. So I
could have:

foo()
foo(String val)
foo(String val, String val2)
foo(String val, Int32 val)

All of which are overloads of each other (they're all called foo).
Think of it as giving you different ways of doing something using
different sets of inputs.

That was confusing me. Thanks for the explanation!

Matt
 
Back
Top