Galen
September 4th, 2008, 04:54 PM
I'm trying to generate tables inside an Access database with an XML schema file. Then I want to fill those tables with data from XML files that are based on the later XML schema. I've been trying forever just to get the tables created inside the database but with no success. I guess I just don't understand ADO .NET yet. Here is the code I'm working with. After I load the XML schema into the dataset I can see that the data set has all the Tables and Columns I want. How do I put those in the database?
public void WriteToDatabase(String xml)
{
TextReader stringReader = new StringReader(xml);
// Create a validating reader that wraps the XmlNodeReader object.
XmlReader reader = XmlReader.Create(stringReader, m_settings);
m_dataSet.ReadXmlSchema("Summary.xsd")
m_dataSet.ReadXml(reader);
m_dataSet.AcceptChanges();
m_oleDbDataAdapter.Fill(m_dataSet);
m_oleDbDataAdapter.Update(m_dataSet);
}
public void WriteToDatabase(String xml)
{
TextReader stringReader = new StringReader(xml);
// Create a validating reader that wraps the XmlNodeReader object.
XmlReader reader = XmlReader.Create(stringReader, m_settings);
m_dataSet.ReadXmlSchema("Summary.xsd")
m_dataSet.ReadXml(reader);
m_dataSet.AcceptChanges();
m_oleDbDataAdapter.Fill(m_dataSet);
m_oleDbDataAdapter.Update(m_dataSet);
}