DylanJones1
asked on
Programtically Importing XML into Access Database Tables
MS Access 2003 has a great Imprt utility for XML. I would like to accomplish the same task programtically using C#, I have search the Google over and never found a true solution. Does anyone here have specific approach.
I can easily read the XML into a dataset but how to get that in MS Access?
I can easily read the XML into a dataset but how to get that in MS Access?
You could read the XML into a DataSet, and then import the rows from the XML file into another table that is bound to the Access database, and then update the database.
ASKER
Yes that is the path I am heading down I was, of course, hoping for something that would leverage the work that the import feature has already accomplished. Can you tell me what I need to do to get my window service to look at its own config file rather than the machine.config?
This
onfiguration config = ConfigurationManager.OpenE xeConfigur ation(Syst em.AppDoma in.Current Domain.Set upInformat ion.Applic ationBase) ;
and this
//for testing my service
Configuration config = ConfigurationManager.OpenE xeConfigur ation(Syst em.Windows .Forms.App lication.E xecutableP ath)
both bomb out
This
onfiguration config = ConfigurationManager.OpenE
and this
//for testing my service
Configuration config = ConfigurationManager.OpenE
both bomb out
What are you trying to get from the config file?
ASKER
A few paths, a databse name, a file filter. I need to read the config file
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Here is my code - this is a windows service that I am debugging via a fom
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="DatabaseUpdaterRemote Path" value="Y:\IPB\Dch" />
<add key="DatabaseUpdaterLocalP ath" value="C:\IPXML\Dch" />
<add key="DatabaseUpdaterFilter " value="*.XML*" />
<add key="DatabaseUpdaterInclud eSubs" value="true" />
<add key="DatabaseName" value="Disconnected.MDB"/>
</appSettings>
</configuration>
onfiguration config = ConfigurationManager.OpenE xeConfigur ation(Syst em.AppDoma in.Current Domain.Set upInformat ion.Applic ationBase) ;
and this
//for testing my service
Configuration config = ConfigurationManager.OpenE xeConfigur ation(Syst em.Windows .Forms.App lication.E xecutableP ath)
Then
RemotePath = config.AppSettings["Databa seUpdaterR emotePath" ].ToString ();
this blows up and the appsettings are empty - it is automatically pulling from machine.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="DatabaseUpdaterRemote
<add key="DatabaseUpdaterLocalP
<add key="DatabaseUpdaterFilter
<add key="DatabaseUpdaterInclud
<add key="DatabaseName" value="Disconnected.MDB"/>
</appSettings>
</configuration>
onfiguration config = ConfigurationManager.OpenE
and this
//for testing my service
Configuration config = ConfigurationManager.OpenE
Then
RemotePath = config.AppSettings["Databa
this blows up and the appsettings are empty - it is automatically pulling from machine.config
Did you try this?
string remotePath = ConfigurationManager.AppSe ttings["Da tabaseUpda terRemoteP ath"];
string remotePath = ConfigurationManager.AppSe
ASKER
Yes That does not work either