Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want insert values in sql server.
C#.net: GUIDs are not random, they are only unique (within a single system). Even a random number generator has limits on it, the minimum and maximum values it will return, and being truly random in sql server(insert values into the table).please say refer Website.


Thanks Advance Friends.
Posted
Comments
Zoltán Zörgő 12-Mar-13 8:33am    
Your question is not complete. You complain about the built-in random number generator, but you don't define the randomness in your terms. The "limitation" that the random function has a maximum is not a limitation. Just as example: how could you store a random number of arbitrary length in a fixed length field? So first of all define your purposes. Since you looked around at GUID, you probably need more a random string than a single number. Does it have to be cryptographic or a general one?
ZurdoDev 12-Mar-13 8:33am    
So, what do you want? You want random numbers? Where are you stuck?
Rekhash 13-Mar-13 5:36am    
i need more the lakhs in random generate code in .net it will stored automatically in the db.

RANDOM.org might help. However, "truly" random numbers are impossible to generate - you need to find the best pseudo-random generator you can.
 
Share this answer
 
Comments
Zoltán Zörgő 12-Mar-13 8:36am    
Interesting collection. My 5!
Take a look at the RNGCryptoServiceProvider class (http://msdn.microsoft.com/en-us/library/system.security.cryptography.rngcryptoserviceprovider.aspx[^])it is generating strong pseudo-random numbers based on a cryptographic algorithm.
I would say this is as "truly" random as you can get in software.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900