CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Random
SQL
DECLARE @RandomNumber float
DECLARE @RandomInteger int
DECLARE @MaxValue int
DECLARE @MinValue int
 
SET @MaxValue = 4
SET @MinValue = 2
 
SELECT @RandomNumber = RAND()
by Jerry Nixon   April 12, 2010 @ 9:37am
Tags: TSQL, Random
373 Views
no comments
 
C#
/*http://www.codesake.com*/
public class MISC
{
      private static Random random = new Random((int)DateTime.Now.Ticks);
      public static int Next(int minValue, int maxValue)
      {
         lock (random)
         {
            return random.Next(minValue, maxValue);
         }
by azmo   July 28, 2009 @ 5:55pm
Tags: Random
218 Views
no comments
 
C#
public static string RandomAlphaNumeric(int digits)
{
  Random random = new Random();
  byte[] buffer = new byte[digits / 2];
  random.NextBytes(buffer);
  string result = String.Concat(
  buffer.Select(x => x.ToString("X2")).ToArray());
  if (digits % 2 == 0)
  {
    return result;
by tomy ismail   July 15, 2009 @ 10:18pm
253 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate