Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Generate a unique key value in code automatically

Posted on 2014-11-21
3
Medium Priority
?
158 Views
Last Modified: 2014-11-21
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
Comment
Question by:AndyAinscow
3 Comments
 
LVL 14

Accepted Solution

by:
Vel Eous earned 2000 total points
ID: 40457008
The Guid structure may be what you are looking for.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 40457035
0
 
LVL 45

Author Closing Comment

by:AndyAinscow
ID: 40457159
Nice idea.  Simple to implement and, these days, memory isn't a real constraint anymore in most cases.
0

Featured Post

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Integration Management Part 2
Loops Section Overview
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question