Newbie trying to bind to dataset

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

  1. MattB

    MattB Guest

    Hello group. I'm new here and to .net (you guys probably never hear that,
    right?). I have some development background, so I'm hoping to get up to
    speed quickly.

    I'm trying to write an ASP.net app using web forms and vb.net that queries a
    c++ dll and displays the return nicely. My dll returns a string that is an
    ado recordset. I figured this should be easy to parse and bind to a
    datagrid, but I keep striking out.

    Here's an example of the return string:

    OK :<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
    xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
    xmlns:rs='urn:schemas-microsoft-com:rowset'
    xmlns:z='#RowsetSchema'>
    <s:Schema id='RowsetSchema'>
    <s:ElementType name='row' content='eltOnly' rs:CommandTimeout='30'>
    <s:AttributeType name='guest_no' rs:number='1' rs:writeunknown='true'>
    <s:datatype dt:type='number' rs:dbtype='numeric' dt:maxLength='19'
    rs:scale='0' rs:precision='17' rs:fixedlength='true'
    rs:maybenull='false'/>
    </s:AttributeType>
    <s:AttributeType name='first_name' rs:number='2' rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='15'
    rs:maybenull='false'/>
    </s:AttributeType>
    <s:AttributeType name='last_name' rs:number='3' rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='20'
    rs:maybenull='false'/>
    </s:AttributeType>
    <s:AttributeType name='birth_date' rs:number='4' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='dateTime' rs:dbtype='timestamp'
    dt:maxLength='16' rs:scale='3' rs:precision='23' rs:fixedlength='true'/>
    </s:AttributeType>
    <s:AttributeType name='phone' rs:number='5' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='8'
    rs:fixedlength='true'/>
    </s:AttributeType>
    <s:AttributeType name='address' rs:number='6' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='30'/>
    </s:AttributeType>
    <s:AttributeType name='city' rs:number='7' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='25'/>
    </s:AttributeType>
    <s:AttributeType name='state' rs:number='8' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='2'
    rs:fixedlength='true'/>
    </s:AttributeType>
    <s:AttributeType name='zip' rs:number='9' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='10'/>
    </s:AttributeType>
    <s:extends type='rs:rowbase'/>
    </s:ElementType>
    </s:Schema>
    <rs:data>
    <z:row guest_no='16099000' first_name='MATT '
    last_name='MESSINGER '/>
    </rs:data>
    </xml>

    I think I'm ok with the 'OK :' at the begining because that would be ignored
    when the parsing takes place.
    It also looks like the way to go would be DataSet.ReadXML, but I can't get
    it to work. In my code behind I have the following in Page_Load:

    Dim myDataSet As New DataSet
    Dim ox As Object, x As String
    ox = CreateObject("ww.main")
    x =
    ox.invoke("<func>lookupguests</func><first_name>matt</first_name><last_name>
    messinger</last_name>")
    TEXTAREA1.Value() = x
    ox = Nothing
    myDataSet.ReadXml(x)

    I get my dll output in the text box - so I know it works to populate x, but
    doesn't like the myDataSet.ReadXml(x) part. (error is The path is too long
    after being fully qualified. - so it's looking for a file instead of a
    string)
    Can anyone give me an example of how I would need to get this to work, and
    how I could then bind that dataset to a grid? Thanks!
    --

    Matt

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

  2. MattB

    Eric Veltman Guest

    Hello MattB,

    MattB wrote:

    > myDataSet.ReadXml(x)
    >
    > I get my dll output in the text box - so I know it works to populate x,
    > but doesn't like the myDataSet.ReadXml(x) part. (error is The path is too
    > long after being fully qualified. - so it's looking for a file instead of
    > a string)


    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.

    Best regards,

    Eric
     
    Eric Veltman, Dec 22, 2003
    #2
    1. Advertising

  3. MattB

    MattB Guest

    Eric Veltman wrote:
    > Hello MattB,
    >
    > MattB wrote:
    >
    >> myDataSet.ReadXml(x)
    >>
    >> I get my dll output in the text box - so I know it works to populate
    >> x, but doesn't like the myDataSet.ReadXml(x) part. (error is The
    >> path is too long after being fully qualified. - so it's looking for
    >> a file instead of a string)

    >
    > 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.
    >
    > Best regards,
    >
    > Eric


    Thanks for the response. Any way you could post a sample? Looking in the
    help files just doesn't seem clear to me.

    Matt
     
    MattB, Dec 22, 2003
    #3
  4. MattB

    Eric Veltman Guest

    Hello Matt,

    MattB wrote:

    > Eric Veltman wrote:
    >> Hello MattB,
    >>
    >> MattB wrote:
    >>
    >>> myDataSet.ReadXml(x)
    >>>
    >>> I get my dll output in the text box - so I know it works to populate
    >>> x, but doesn't like the myDataSet.ReadXml(x) part. (error is The
    >>> path is too long after being fully qualified. - so it's looking for
    >>> a file instead of a string)

    >>
    >> 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.
    >>
    >> Best regards,
    >>
    >> Eric

    >
    > Thanks for the response. Any way you could post a sample? Looking in the
    > help files just doesn't seem clear to me.


    I've never used this stuff myself, and don't have dotnet on my Linux PC
    at home, but from what I've read from the docs, I think this is how to
    load the XML from string :

    myDataSet.ReadXml(New StringReader(x))

    If it doesn't work, take a look at the class doco at
    http://tinyurl.com/1qzi

    Regards,

    Eric
     
    Eric Veltman, Dec 22, 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. HNguyen
    Replies:
    0
    Views:
    1,194
    HNguyen
    Jun 3, 2004
  2. Tea Cup
    Replies:
    0
    Views:
    560
    Tea Cup
    Aug 20, 2003
  3. mr2_93
    Replies:
    1
    Views:
    3,645
    mr2_93
    Oct 2, 2005
  4. Replies:
    0
    Views:
    605
  5. bill yeager

    trying to bind a typed dataset to a datagrid

    bill yeager, Sep 16, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    166
    bill yeager
    Sep 17, 2004
Loading...

Share This Page