OleDb Connection to XML File

  • Thread starter Thread starter Jason Barnett
  • Start date Start date
J

Jason Barnett

I would like to create an OleDb connection to an XML File, but I cannot find
information about the connection string parameters. Is this possible?

I've got some parameters that an application uses and I have decided that it
would be best to store it in a database-like storage area. I figured I could
store the values in a CSV, XLS, or MDB file and maintain the parameters
through a OleDb connection. However, I wondered if I could use XML as well.
I don't want to rely on a server connection and I don't want to load anything
on the client.

For what it's worth, I'm using VS2005.
 
I've built an assembly that processes "Job" objects. A Job object stores
information about an automated task. This Job object could have a collection
of parameters that are needed to run, and those parameters are fed by the
executing assembly. The executing assembly I'm currently developing is a
Singleton-like web service designed to run a collection of Job objects. I'm
trying to design it so that it has little or no knowledge of the Job objects.

With that in mind, I don't believe storing values in a config file will work
because 1) the web.config file does not allow you to save AppSettings, and 2)
the executing assembly must know about the parameters it's loading (it must
be recompiled each time a parameter is added).

I've thought of storing the parameters in a local data source (a flat-file
of some sort), which the executing assembly could load. The data source
would store the Job identifier, the parameter identifiers and values, and a
simple Update statement for updating the parameter values after a job is
complete. Other approaches I'm considering is storing a snippet of code that
the executing assembly would have to process (not sure if that's feasible),
or writting Jobs as assemblies that the executing assembly dynamically loads
based on a common interface found with Reflection.

Bottom line... I'm exploring my options and wondering how (if possible) to
connect to an XML file with OLE DB.
 
I would code up a strong dataset, and use that. (as previously mentioned).

Be careful if you have multiple threads reading/writing data.

The DataSet.WriteXml() an DataSet.GetXml() ....... it doesn't get much
easier than that.

I do this for small config data stuff all the time.


EMPHASIS on the "small".
 
Back
Top