Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Generate a unique key value in code automatically

In database tables there is the possibility to automatically generate a unique primary key for a record.

What I would like is this sort of functionality BUT nothing to do with a database.  The data will be structured (tree like) and handled in the app.  I had the thought that maybe there is a built in class in C# that I can use to generate a unique value as an identifier.
I can code one myself so I am asking only about a built in, ready to use class if there is one.
0
AndyAinscow
Asked:
AndyAinscow
1 Solution
 
Vel EousResearch & Development ManagerCommented:
The Guid structure may be what you are looking for.
0
 
Éric MoreauSenior .Net ConsultantCommented:
0
 
AndyAinscowAuthor Commented:
Nice idea.  Simple to implement and, these days, memory isn't a real constraint anymore in most cases.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now