This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > September 2004 > Database Independent aplication using XML





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Database Independent aplication using XML
Hari Shankar

2004-09-29, 7:15 am

Dear all
I have to develop a database independent application in c# 2003. It means
the underlying database should be anything like ACCESS, Oracle or SQL and my
application should not get affected if i change between databases. i also
have a requirement of storing 10,000 user records in my database. This
database can also be created by our customers and weshould be able to use
it.
After reading ADO.NET i felt convinced that it is the solution for my
requirement. But later i was thinking when i want to create a database
independent application why i should use a database first of all, instead i
can use XML.

The following are the points supporting it.
1. XML universally accepted/standardized.
2. No hassle of connection to a database server, changing the DB adapters,
customers having different databases facing problems in entering the data
3. Easily transferable and portable. Anybody can edit an XML file as there
are lot of freeware available.

The following are the points opposing it
1. Performance of parser while supporting 10,000 user records
2. Is it wise to think XML can be used in this way?

Please help me out. Also from where can i get a sample c# applications
storing the large user data (10,000 records) in XML file


David

2004-09-29, 12:40 pm

The reason you should use a database is contained in your message:

"This
> database can also be created by our customers and weshould be able to use
> it."


They might want to use something other than an XML file.

I was faced with a similar situation recently. I had to get data from a
database. However, it was possible to create backups of portions of that
database as an XML file, and the customer wanted to manipulte, view, and
otherwise deal with that XML file just as they did the main database.

My solution was to convert everything to a dataset. All of my manipulations
and viewing of the information was done from a dataset. Then, I had a
"FromSource" and a "ToDestination" function. "FromSource" would read
information from a source and populate the dataset. "ToDestination" took the
dataset and sent it to the destination.

"ToDest" looked something like this:

switch(destinationselected)
{case PossibleDestinations.XMLFile: ds.WriteXML(myfilename);break;
case PossibleDestinations.BackToTheDatabase: mydataadapter.update(ds); break;
}



As for sample applications with large records, write one:

for (i=1;i<10000;i++)
{//Insert a new record into the dataset.
}
ds.WriteXML();

I've done it. Don't open the resulting XML file using Internet Explorer
unless you have a very fast machine. You might be waiting a while.


"Hari Shankar" wrote:

> Dear all
> I have to develop a database independent application in c# 2003. It means
> the underlying database should be anything like ACCESS, Oracle or SQL and my
> application should not get affected if i change between databases. i also
> have a requirement of storing 10,000 user records in my database. This
> database can also be created by our customers and weshould be able to use
> it.
> After reading ADO.NET i felt convinced that it is the solution for my
> requirement. But later i was thinking when i want to create a database
> independent application why i should use a database first of all, instead i
> can use XML.
>
> The following are the points supporting it.
> 1. XML universally accepted/standardized.
> 2. No hassle of connection to a database server, changing the DB adapters,
> customers having different databases facing problems in entering the data
> 3. Easily transferable and portable. Anybody can edit an XML file as there
> are lot of freeware available.
>
> The following are the points opposing it
> 1. Performance of parser while supporting 10,000 user records
> 2. Is it wise to think XML can be used in this way?
>
> Please help me out. Also from where can i get a sample c# applications
> storing the large user data (10,000 records) in XML file
>
>
>

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews