Re: What to search for

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Miro wrote:
In my scenario I created - I am trying to create a dummy poker timer for him and save his settings to an xml file.
That way sql express doesnt need to be installed or anything.
(Basically 1 step up from a csv file - so I can learn a bit on how to use xml files - and he gets a dummy poker timer )

So this xml file is never shared by anyone / never used by multiple people at the same time. It basically just stores the rounds & blinds.

With a scenario like this - yes I see how a GUID would be better than my unique auto-incrementing key.
Because with this scenario - if i use my auto-incremeneting key idea - yes everything works - but its still a negative# that is written to the xml file. Your GUID would fix it - or I would have to manually run through and search for negative keys and convert them to positive ones.

Why would negative key values be a problem in the first place?

I am now just trying to think of an example ( cause I thought a poker timer would be simple enough ), where my xml idea with keys would work.
But from what I have come to learn, is basically - if "I/Anyone" plans to use an xml file as a 'settings file (like in my case)", then if I want to have keys - I should ALWAYS use a GUID as the key, and the Unique Auto-Increment Key setting - use that only if ever connecting to a database.

Is that a correct assumption?

No.

A GUID is excellent if you have distributed data, i.e. you need to create unique keys without having all the data available at the moment. In your case your data is limited to your xml file, so you always have all the data. Therefore you can always create a unique value without problem, and the usefulness of a GUID is very small.

--
Göran Andersson
_____
http://www.guffa.com
.



Relevant Pages

  • Re: remoting object access information from local xml file frequenctly
    ... You can definately use an object on your server to load the xml file ... I would do is create a class that loads the xml file settings into the ... server's memory and then create a shared ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: WebService update
    ... external server. ... I want to know how to update at runtime the webservice object of my ... App.config is just another XML file. ... You create a routine on a Timer and read the app.comfit periodically to pick up new settings, using an XML Document object, to pick-up the new URL. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: app.config and user.config files
    ... change the settings *once*. ... want to reconsider investing your time in programming. ... I have a UI to the XML file on my change list, ... Pete: I'm very sorry Pete, but I thought I was having a discussion ...
    (microsoft.public.dotnet.framework)
  • Re: Remember Previous Settings for an Application
    ... > write to an XML file from VB.net? ... My.SEttigns and the settings designer. ... If for all users, and you are using VB 2008, use XDocument, e.g: ... Dim setting1 As String = doc....Value ...
    (microsoft.public.dotnet.languages.vb)
  • Re: remoting object access information from local xml file frequen
    ... some of my findings..(command window access i/p vs o/p) ... > without IIS and the Settings object can be anything you want it to be so it ... > configurations and can't rely being in IIS. ... >>> I would do is create a class that loads the xml file settings into the ...
    (microsoft.public.dotnet.framework.remoting)