problem with ReadXML file path. please help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlouHond
    New Member
    • Jul 2007
    • 3

    problem with ReadXML file path. please help

    Hi, I'm using VB.net 2005.

    My dataset is called DsDetails1
    My XML file is called details.xml

    When I use ReadXML, is there any way that I can set the path of this XML file to be read to be the root of my VB sollution. I need to be able to move the project around to different computers while coding, and I do not want to change the connection string every time.

    tried:
    Code:
    DsDetails1.ReadXml("|DataDirectory|\Details.xml")
    as with a database, but that didn't work.

    Is there anything similar that I can do? Please help!
  • BlouHond
    New Member
    • Jul 2007
    • 3

    #2
    Hi - just found my answer in the MDSN forums.

    In case anyone else would like to know the answer:
    I put my details.xml file in the bin\debug folder of the sollution and use the following code:

    Code:
    DsDetails1.ReadXML(Application.StartupPath + "\\details.xml")

    Comment

    Working...