Results 1 to 7 of 7

Thread: Reading a XML File into a DataSet Help!!!

  1. #1

    Thread Starter
    Lively Member nokia8210's Avatar
    Join Date
    Dec 2002
    Location
    Coventry
    Posts
    92

    Reading a XML File into a DataSet Help!!!

    Help Again!!
    How Do Read an XML file into a dataset any clues??

    i've looked at the microsoft site and it's just got me even more confused!!

    sorry i'm new to this!!!

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I believe it is:
    VB Code:
    1. myDataSet.ReadXml(...)

  3. #3

    Thread Starter
    Lively Member nokia8210's Avatar
    Join Date
    Dec 2002
    Location
    Coventry
    Posts
    92
    i have tried that and it doen't seem to add anything into the dataset.

    has anyone got some code for me to look at i'm using an xml document from excel!

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    ReadXML is what you are looking for, post your code. Should just be myDataSet.ReadXML(filepathhere)

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    From MSDN:
    If the DataSet does not contain a schema, and there is no inline schema, no data is read.

    Inline schema can be defined using XML Schema definition language (XSD) schema. For details about writing inline schema as XML Schema, see Generating DataSet Relational Structure from XML Schema (XSD).


    What that means to you is this: If the DataSet cannot determine how to construct the data, then you must define the XSD.

    Look here for some more examples, hints:


    http://msdn.microsoft.com/library/de...e_from_xsd.asp


    http://msdn.microsoft.com/library/de...setfromxml.asp

  6. #6
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    VB Code:
    1. ds.ReadXml(fs, XmlReadMode.InferSchema)

    That worked for me on a sample workbook.

  7. #7

    Thread Starter
    Lively Member nokia8210's Avatar
    Join Date
    Dec 2002
    Location
    Coventry
    Posts
    92

    Help needed again

    Hi i gave up on the xml thing but now it has come back and bitten a big chunk out of my ass.

    i have now got a xml file with 10,000 names and address on it and i need to import this into a dataset then save it on to the main database.

    i have got it reading as above (thanks guy's) now i need a little more help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width