Best way to store data

  • Thread starter Thread starter Crirus
  • Start date Start date
C

Crirus

Hi
I have about 1000 records of users to store.. I dont like the ideea of a
database server...
How to store does data in a structured way?
An XML?
How big can became such an xml, because I whould like to load it and search
for data.
Can I search for some data without loading all xml into memory?
 
* "Crirus said:
I have about 1000 records of users to store.. I dont like the ideea of a
database server...
How to store does data in a structured way?
An XML?
How big can became such an xml, because I whould like to load it and search
for data.
Can I search for some data without loading all xml into memory?

If there are more than 1,000 records, I wouldn't use XML. XML files
only make sense if they are smaller than ~20 KB. You may want to use an
Access database or SQL Server (or MSDE).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
I could use an Access DB and manipulate data with ADO... anyway, I dont
think I will have more than 1000 records with about 6-7 fields, like general
datas about a used.
That's why i'm undecided
 
Hi Crirus,

There was a query the other day from someone who transfers data between his
database and Excel using XML. Another guy was using Xml to stream objects from
one machine to another. These guys were talking about Xml strings in the MBs range!!

Xml will be fine to start off with - you can simply save it in a textfile if you like.
It's
not worth doing anything more complicated unless you find the performance to be
inadequate.

Regards,
Fergus
 
Hi Crirus,

(That was wierd).

There was a query the other day from someone who transfers data
between his database and Excel using XML. Another guy was using Xml
to stream objects from one machine to another. These guys were talking
about Xml strings in the MBs range!!

Xml will be fine to start off with - you can simply save it in a textfile if
you like. It's not worth doing anything more complicated unless you find
the performance to be inadequate.

Cheers,
Fergus
 
Well, I need a structured and easy way to store data about some users...

Something like:

First Name, Last Name, Age, Gender, Country, UserName, Password...

I whould like to search later for a particular user... Do I have to load all
xml into a xmlDocument variable and query for some nodes?
Is there a way to search the XML without loading all data into memory?
 
Hi Fergus,

Strange that you don't know the name from that guy who was telling this, who
got that idea from Jay B by the way.

:-))

Cor
 
Hi Crirus, Herfried, Fergus,

If you make your XML as a XML dataset, you can use it as a dataset.
Just using dataset.readxml("xmlfile"))

But see what I write XML as a dataset, not every XML file is a dataset.

It satys in memory and afterwards you can use a dataset.writeXML("xmlfile")
to put it back..

(Fergus and Herfried, did you see that genealogic website of my, that is
based on that principe, there are datasets build, that is read using xmldoc
on the clientside.)

It is of course always single usermode.

Cor
 
Hi Crirus,

I will, but did you ever before work with a dataset?

Before I write stupid things.

Cor
 
I know about ADO so ... may understand allready what is a dataset, just
dindt knew about the control..
I thought that is only a class, somehwere
 
Anyway, I'm interested how a query is made on a dataset... Do I have to load
all xml in the dataset or something?
 
Crirus,

A dataset is nothing than a big object that stores

A three dimensional table consisting of
tables
which has rows
which has items
And a lot of all kind of information about that dataset.

When you read a dataset clean from XML with nothing in it but elements and
without a XSD the only thing you get are tables, rows and items.

The first item in the first row in the first table is represented (let say
that the first item is "item")

dataset.tables(0).rows(0)("item")

You can access that as every other collection you are using and on a lot of
other ways also.

Cor
 
Hi Cor,

Sorry, I'n not getting this one - Some guy telling what? And what idea?

Regards,
Fergus
 
Hi Fergus,

You were helping someone with a problem about an export from a SQL file to a
Exel file or something I thought.

Then it became very strange and even you said "sorry I think I cannot help
you anymore". Then I posted a solution by using XML, Jay B said that a long
time ago again, and I did remember me that and made an example of 3 lines of
code that was all that was needed. I think you have seen it but paid no
attention further to it.

So when you say "someone", I thought you did mean me.
Just for fun, no reason to call my name I was just trying to bring you in
that confuse state.

:-))

Cor
 
Hi Crirus, Cor,

Yes, you'll have to load the Xml in - whether you search with a DataSet,
XmlDocument or File.ReadToEnd and Instr!

XmlDocument will allow you to search the tree structure and do XPath queries.
The DataSet will allow you to do Filtering and sorting, etc. Which would be best or
most efficient, etc is difficult to know. XPath will mean getting into a new area (I
guess),
ie. XSLT which might be interesting.

Regards,
Fergus
 
Back
Top