Ho do i connect to an XML file using C#.net?
-
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
-
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
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
-
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
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 ??
-
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 ??
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