Using XML as a data source
-
Been searching eveything I know to search and cant find anything specific enough. Is there a way to make an XML file into a data source so I can take advantage of the Data-Aware capibilities in Visual Studio 2008. I would like to use the Data Source and Data Navigator to develop a simple data entry form that had 6 data bound textboxs and a child DataGridView with the ability to add, delete and modify some small(300-500 items) xml files. In other words use the XML files like I would use SQL server. Thanks in advance for any comments or suggestions and links to any examples would be helpful. rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
-
Been searching eveything I know to search and cant find anything specific enough. Is there a way to make an XML file into a data source so I can take advantage of the Data-Aware capibilities in Visual Studio 2008. I would like to use the Data Source and Data Navigator to develop a simple data entry form that had 6 data bound textboxs and a child DataGridView with the ability to add, delete and modify some small(300-500 items) xml files. In other words use the XML files like I would use SQL server. Thanks in advance for any comments or suggestions and links to any examples would be helpful. rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...
Well sort of. I do not know of a way to do this directly, although there may be one. However, the
DataSet
class has aReadXml
method as, I believe, does theDataTable
class. Obviously they both also haveWriteXml
methods too. So you can create a DataSet, or DataTable, in memory and read the XML into it. From then on it is just like using SQL Server. If you Google/Bing for dataset.readxml you will find loads of examples.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Well sort of. I do not know of a way to do this directly, although there may be one. However, the
DataSet
class has aReadXml
method as, I believe, does theDataTable
class. Obviously they both also haveWriteXml
methods too. So you can create a DataSet, or DataTable, in memory and read the XML into it. From then on it is just like using SQL Server. If you Google/Bing for dataset.readxml you will find loads of examples.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
Been searching eveything I know to search and cant find anything specific enough. Is there a way to make an XML file into a data source so I can take advantage of the Data-Aware capibilities in Visual Studio 2008. I would like to use the Data Source and Data Navigator to develop a simple data entry form that had 6 data bound textboxs and a child DataGridView with the ability to add, delete and modify some small(300-500 items) xml files. In other words use the XML files like I would use SQL server. Thanks in advance for any comments or suggestions and links to any examples would be helpful. rafone
Statistics are like bikini's... What they reveal is astonishing ... But what they hide is vital ...