Working against Database vs XML file?

  • Thread starter Thread starter Lars Netzel
  • Start date Start date
L

Lars Netzel

I'm doing a little application where I need to store some information very
similar to a table in a database. I don't want to use a database. mostly
cause I feel it's a bit overkill for only one table but also cause I want
to learn more about working with XML.

So... I'm using a Dataset to write the XML to the file.

My problem: I need to use some sort of Unique Identifier per post, is that
possible to have in a XML file? How do I do this?
I guess it's fine to use the Incement thing in the datatable in the dataset
but what about the second time I open the application... and I want to load
the stuff from the XML file.. how do I manage that to keep the unique data
and not overwritten any IDs?

regards
/Lars Netzel
 
Lars,

* "Lars Netzel said:
I'm doing a little application where I need to store some information very
similar to a table in a database. I don't want to use a database. mostly
cause I feel it's a bit overkill for only one table but also cause I want
to learn more about working with XML.

So... I'm using a Dataset to write the XML to the file.

My problem: I need to use some sort of Unique Identifier per post, is that
possible to have in a XML file? How do I do this?

Use a GUID, for example. You can use the 'System.Guid' class to create
a GUID and convert it to a string.
 
did'nt really understand that but I managed to Read from XML with the
Dataset itself and since I used the AutoIncrement = True in the datatable it
was all automatic..:)

So I have no problems with this now!

/Lars
 
Back
Top