none
Populating a Brand new Empty Database from XML RRS feed

  • Question

  • Hi everybody,

    this how I create my Oledb database using the ADOX namespace.

     

    Code Snippet

    CatalogClass PracticeCatalog = new CatalogClass();

    PracticeCatalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbName + ".mdb" +";Jet OLEDB:Engine Type=5");

    Marshal.FinalReleaseComObject(PracticeCatalog.ActiveConnection);

    Marshal.FinalReleaseComObject(PracticeCatalog);

     

     

    And this is the data

     

    <?xml version="1.0" standalone="yes"?>
    <Practice>
      <Table>
        <PRACTICEKEY>2001-02-26T13:19:58-05:00</PRACTICEKEY>
        <NAME>Sample Healthcare Practice</NAME>
        <ADDRESS1>125 Main Street</ADDRESS1>
        <ADDRESS2 />
        <CITY>Lawrenceville</CITY>
        <STATE>KY</STATE>
        <ZIP>00135-1111</ZIP>
      </Table>
    </Practice>

     

     

    this is where it gets messy:

     

    Code Snippet

    using (OleDbConnection Connection = new OleDbConnection(csSettings.ConnectionString))

    {

    Connection.Open();

    OleDbDataAdapter adapter = new OleDbDataAdapter(????, Connection);

    DataSet PracticeDS = new DataSet();

    PracticeDS.ReadXml("PracticeData.xml");

    adapter.Update(PracticeDS.Tables[0]);

    Connection.Close();

    }

     

     

    how do I resolve this issue? I can definitely iterate through the XML and add the table and fields manually, but I don't want to do that since now the DataSet has everything.

    Thank you

    Tuesday, September 4, 2007 2:50 PM

All replies

  • Guys I need a little help here,

    Here is the new situation, forget about the XML. I'm using WCF with TCP binding. when I populate a table on the client side and I make change to it. How do I save the changes back the database knowing that da object was destroyed when the Populate message is executed. Please help.

    Monday, October 1, 2007 9:08 PM