Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Generate a unique key value in code automatically

Posted on 2014-11-21
3
Medium Priority
?
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 44

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

670 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