473,320 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Creating a UNIQUE value

I need to create a UNIQUE number similar to a GUID but all numbers. Does
anyone know of an algorithm or anything?

TIA,

Dave
Jul 21 '05 #1
2 1271
Hi David,

In case you are looking at how to create GUID, then the framework has a
class called System.Guid, which does this...

Very simple... Have a look at these links....for code snippets
http://www.csharphelp.com/archives/archive188.htm
http://msdn.microsoft.com/library/de...ClassTopic.asp

In case you want to write / use algorithm for generating the number, then
check this link for code snippet in C#...
http://www.c-sharpcorner.com/1/unique.asp

HTH,

Need any help, do post a msg back..
Happy Coding


"David Pope" wrote:
I need to create a UNIQUE number similar to a GUID but all numbers. Does
anyone know of an algorithm or anything?

TIA,

Dave

Jul 21 '05 #2
Hi David

How about System.DateTime.Now.Ticks

it gives you a unique number as long as the number is not created too
rapidily.....

just an idea....

"David Pope" <dp***@nospam.satx.rr.com> wrote in message
news:uR*************@TK2MSFTNGP12.phx.gbl...
I need to create a UNIQUE number similar to a GUID but all numbers. Does
anyone know of an algorithm or anything?

TIA,

Dave

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: kevin parks | last post by:
hi. I've been banging my head against this one a while and have asked around, and i am throwing this one out there in the hopes that some one can shed some light on what has turned out to be a...
4
by: RCS | last post by:
We have sort of a centralized single-signon written in ASP.NET for all of our legacy ASP and ASP.NET apps.. There are around 1200 users and something like 2 dozen apps. Everyonce in a while, a user...
7
by: Robin | last post by:
In a current .Net solution (using VB.Net) has a 3 tier architecture of Web interface, Data Access Layer and Database. How do I implement business logic and class layers into this solution?
1
by: Danny Liberty | last post by:
I need some opionions on an issue here... Suppose I want to keep a collection of objects, each need to be uniquely identified by a number. This number has no meaning as long as it's unique, so it...
8
by: DaTurk | last post by:
Hi, I was just curious how you would go about creating a unique identifier with 3 ints.
3
by: travis.downs | last post by:
Hi, I'm trying to use a macro to create a unique temporary variable name, such as #define TEMP_OBJ(string) MyType obj_ <some magic here(string); So something like TEMP_OBJ("foo")
4
by: redqil | last post by:
The problem I am facing is that an integer is the ideal representation for many different classes I am using. I want to write overloaded functions that are able to differentiate between the classes...
13
by: jkimbler | last post by:
As part of our QA of hardware and firmware for the company I work for, we need to automate some testing of devices and firmware. Since not everybody here knows C#, I'm looking to create a new...
4
by: sekundes | last post by:
hi im new here and still a beginner in C. i need an answer to this problem and hopefully u can help me in this. we have this challenge asked by an instructor to create an array program that will...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.