Overload

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!
 
C

Craig Deelsnyder

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.
 
M

MattB

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top