Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Ho do i connect to an XML file using C#.net?

Ho do i connect to an XML file using C#.net?

Scheduled Pinned Locked Moved Database
csharpdatabasequestionsql-serversysadmin
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JDUK
    wrote on last edited by
    #1

    I dont have SQL server, just an XML file on my hard drive. How do i use Server Explorer to build aconnection to that XML file? I can, so far, load the file into a dataset using: DataSet MDS = new DataSet(); MDS.ReadXml("C:\\Students.xml"); But this doesnt allow for manipulaiton e.g: SELECT, DELETE, INSERT INTO, etc.... Does it?? I've had a bash conecting to an Access database and mangaed to manipulate it and do every thing i need to really.... But i need to be able to do this with an XML file and the informaiton in : Developing Windows Based Applictions seems a bit thin with regards connecting to and altering XML files. Thanks

    C 1 Reply Last reply
    0
    • J JDUK

      I dont have SQL server, just an XML file on my hard drive. How do i use Server Explorer to build aconnection to that XML file? I can, so far, load the file into a dataset using: DataSet MDS = new DataSet(); MDS.ReadXml("C:\\Students.xml"); But this doesnt allow for manipulaiton e.g: SELECT, DELETE, INSERT INTO, etc.... Does it?? I've had a bash conecting to an Access database and mangaed to manipulate it and do every thing i need to really.... But i need to be able to do this with an XML file and the informaiton in : Developing Windows Based Applictions seems a bit thin with regards connecting to and altering XML files. Thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      It's not a server, why would server explorer connect to it ? Why do you need to put it into a dataset, instead of an XmlDocument ? I have no idea how far the Xml support goes in a DataSet, but I know you can perform selects on a datatable, at least. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

      J 1 Reply Last reply
      0
      • C Christian Graus

        It's not a server, why would server explorer connect to it ? Why do you need to put it into a dataset, instead of an XmlDocument ? I have no idea how far the Xml support goes in a DataSet, but I know you can perform selects on a datatable, at least. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

        J Offline
        J Offline
        JDUK
        wrote on last edited by
        #3

        Can you give me an example of how i would perform a select on a DataSet please? The only methods i have read in the book involve using the SqlConnection i.e string MyCom ="SELECT * WHERE id = 001" SqlCommand MySqlCom = SQLCONNECTION.CreateCommand(); MySqlCom.CommanText = MyCom; etc... As you can see doing that requires you to refference the SqlConnection. So having no connection means i couldnt select in this way (and its the only way i have used up to now). Also the Access files i have been using are not servers either but you can ad them through server explorer ??

        C 1 Reply Last reply
        0
        • J JDUK

          Can you give me an example of how i would perform a select on a DataSet please? The only methods i have read in the book involve using the SqlConnection i.e string MyCom ="SELECT * WHERE id = 001" SqlCommand MySqlCom = SQLCONNECTION.CreateCommand(); MySqlCom.CommanText = MyCom; etc... As you can see doing that requires you to refference the SqlConnection. So having no connection means i couldnt select in this way (and its the only way i have used up to now). Also the Access files i have been using are not servers either but you can ad them through server explorer ??

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          JDUK wrote: Also the Access files i have been using are not servers either but you can ad them through server explorer ?? Yes, because they are in fact a database. The DataView has a RowFilter which basically operates like a select. I thought there was another object which held a table and took a select, but I could be thinking of that one. Christian I have drunk the cool-aid and found it wan and bitter. - Chris Maunder

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups