Overload

Discussion in 'ASP .Net' started by MattB, Dec 22, 2003.

  1. MattB

    MattB Guest

    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!

    --

    Matt

    "Gravity. It's not just a good idea, it's the law!"
     
    MattB, Dec 22, 2003
    #1
    1. Advertising

  2. Hi Matt,

    try this:

    string XML = ... XML value;

    DataSet DS = new DataSet();
    DS.ReadXml( new StringReader(lcXML) );

    +++ Rick ---

    --

    Rick Strahl
    West Wind Technologies
    http://www.west-wind.com/
    http://www.west-wind.com/webblog/
    ----------------------------------
    Making waves on the Web


    "MattB" <> wrote in message
    news:bs7r0m$af4vc$-berlin.de...
    > 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!
    >
    > --
    >
    > Matt
    >
    > "Gravity. It's not just a good idea, it's the law!"
    >
    >
     
    Rick Strahl [MVP], Dec 22, 2003
    #2
    1. Advertising

  3. MattB wrote:

    > 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 Deelsnyder
    Microsoft MVP - ASP/ASP.NET
     
    Craig Deelsnyder, Dec 23, 2003
    #3
  4. MattB

    MattB Guest

    Craig Deelsnyder wrote:
    >
    > 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
     
    MattB, Dec 23, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eph0nk

    Error: Overload resolution failed

    Eph0nk, Oct 23, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,887
    Eph0nk
    Oct 23, 2003
  2. Babs
    Replies:
    0
    Views:
    3,091
  3. Greg Collins [InfoPath MVP]

    Preventing overload of SQL hits

    Greg Collins [InfoPath MVP], Apr 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    353
    Bruce Barker
    Apr 16, 2005
  4. Piotre Ugrumov
    Replies:
    3
    Views:
    392
    Nick Hounsome
    Jan 25, 2004
  5. Ying-Chieh Liao

    function overload (not operator overload)

    Ying-Chieh Liao, Oct 11, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    277
    Sherm Pendley
    Oct 11, 2004
Loading...

Share This Page