[dba-VB] C# Databases without borders

Gustav Brock Gustav at cactus.dk
Tue Jan 11 10:42:56 CST 2011


Hi John

First, I don't think SQL Server (Express) is overkill as you - as I understand - have several engines running, so one tiny database more a less wouldn't make noticeable difference.

Then, you could for a single user app use the SQL Server Compact (file based as Access/JET) or even an mdb file.
Or, you could use the built-in XML storage which is simple and fun. Just remember that it writes _all_ tables of the dataset in one go when you call WriteXml() as shown below - if you attempt to write one table only (which can be done), only this table will be held in the XML file, all other tables will get lost.

This we discussed 2009-09-02:

For example, read one XML file with one dataset containing several tables:

        private void InitializeDataSet()
        {
            _dataBaseFile = Path.Combine(_execPath, _dataFileName);
            this.DlDataSet.ReadXml(_dataBaseFile);
        }

Write the (modified) dataset to one XML file:

        private void SaveData()
        {
            this.DlDataSet.WriteXml(_dataBaseFile);
        }

Resulting XML for one table with one record:

<?xml version="1.0" standalone="yes"?>
<DataSetDL xmlns="http://tempuri.org/DataSetDL.xsd">
  <DataTableSys>
    <Id>0</Id>
    <SmtpServer>smtp.webpartner.dk</SmtpServer>
    <SmtpUserName />
    <SmtpPassword />
    <EmailAddressSend>cactus at cactus.dk</EmailAddressSend>
    <EmailAddressReceive>gustav at cactus.dk</EmailAddressReceive>
  </DataTableSys>
</DataSetDL>

/gustav



>>> jwcolby at colbyconsulting.com 11-01-2011 16:58 >>>
I want to build a little application where I have a very simple zip code table of about 40 thousand 
zip codes, with things like household count, population count, lat and long.  My application would 
take lists of zip codes and sum the population and household counts, count the zips etc and put a 
count on the screen in a table format.

I already do this using SQL Server to hold the zip code table.  I get the zip lists into csv files, 
then create a table inside of SQL Server, join on the zip code and sum the population and household 
counts.

Now I want to build an application to do this but SQL Server is way overkill.

Can I use a csv or even xml to hold the zip table, create an xml table to hold the zip lists entered 
by the user and so forth.  IOW I need a low impact alternative to SQL Server.  Even express is just 
way overkill for this.

Somewhere in the back of my mind I am thinking that ADO.net knows how to load tables, create 
relationships between tables, enforce the join etc.  IOW do the store entirely in XML and just use 
ADO to do the rest.

Is this possible?  Would the speed be acceptable for a join between tblZipMaster and tblZipUserXyz 
on Zip count(zip) sum(household) etc. directly in memory.
-- 
John W. Colby
www.ColbyConsulting.com 





More information about the dba-VB mailing list