Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to insert data onto database in c# Pin
jyoteermoy18-Apr-12 19:53
jyoteermoy18-Apr-12 19:53 
GeneralRe: How to insert data onto database in c# Pin
Richard MacCutchan18-Apr-12 20:53
mveRichard MacCutchan18-Apr-12 20:53 
AnswerRe: How to insert data onto database in c# Pin
Abhinav S18-Apr-12 19:49
Abhinav S18-Apr-12 19:49 
AnswerMessage Removed Pin
18-Apr-12 19:59
Harsha Dev18-Apr-12 19:59 
GeneralRe: How to insert data onto database in c# Pin
Abhinav S18-Apr-12 20:01
Abhinav S18-Apr-12 20:01 
GeneralRe: How to insert data onto database in c# Pin
Harsha Dev18-Apr-12 20:04
Harsha Dev18-Apr-12 20:04 
AnswerRe: How to insert data onto database in c# Pin
Sentenryu19-Apr-12 5:38
Sentenryu19-Apr-12 5:38 
QuestionC# Repeating Random Problem Pin
Midnight Ahri18-Apr-12 17:32
Midnight Ahri18-Apr-12 17:32 
this is my array variable,
C#
int[] x = null; 
x = new int[10];
int[] y = null; 
y = new int[10];

and this is my random function,
C#
private int Randomize(int MinValue, int MaxValue)
        {
            Random Random = new Random();
            return Random.Next(MinValue, MaxValue);
        }

this is how i random all of that variable,
C#
for (int i = 0; i < 10; i++)
        {
            x[i] = Randomize(1, 60);
            y[i] = Randomize(1, 10);
        }

and the result is,
C#
x[0] = 42   y[0] = 3
x[1] = 42   y[1] = 3
x[2] = 42   y[2] = 3
x[3] = 42   y[3] = 3
x[4] = 42   y[4] = 3
x[5] = 42   y[5] = 3
x[6] = 42   y[6] = 3
x[7] = 42   y[7] = 3
x[8] = 42   y[8] = 3
x[9] = 42   y[9] = 3


am i missing something in my random function?
i've searched it in google and still found Random.Next()

** MODIFIED
i found out in google that Random.Next generating same value because I execute it at the same time.
so i put like this,
C#
private int Randomize(int MinValue, int MaxValue)
        {
            Thread.Sleep(100);
            Random Random = new Random();
            return Random.Next(MinValue, MaxValue);
        }

nah this time the value disorder epicly,
but yes i have to wait,
keep searching for other way,
and please someone help me.

Thanks before,
VK

modified 19-Apr-12 0:13am.

AnswerRe: C# Repeating Random Problem Pin
egenis18-Apr-12 19:04
egenis18-Apr-12 19:04 
AnswerRe: C# Repeating Random Problem Pin
phil.o19-Apr-12 0:32
professionalphil.o19-Apr-12 0:32 
AnswerRe: C# Repeating Random Problem Pin
tuhami23-Apr-12 8:08
tuhami23-Apr-12 8:08 
Questionsimple memory leak Pin
Member 784572018-Apr-12 15:52
Member 784572018-Apr-12 15:52 
AnswerRe: simple memory leak Pin
Abhinav S18-Apr-12 16:53
Abhinav S18-Apr-12 16:53 
GeneralRe: simple memory leak Pin
Vipin_Arora19-Apr-12 2:39
Vipin_Arora19-Apr-12 2:39 
AnswerRe: simple memory leak Pin
Vipin_Arora18-Apr-12 19:09
Vipin_Arora18-Apr-12 19:09 
GeneralRe: simple memory leak Pin
VJ Reddy20-Apr-12 4:53
VJ Reddy20-Apr-12 4:53 
GeneralRe: simple memory leak Pin
Vipin_Arora20-Apr-12 6:17
Vipin_Arora20-Apr-12 6:17 
QuestionSearch form problem Pin
Amr Mohammed Rashad18-Apr-12 13:39
Amr Mohammed Rashad18-Apr-12 13:39 
AnswerRe: Search form problem Pin
Amr Mohammed Rashad18-Apr-12 18:31
Amr Mohammed Rashad18-Apr-12 18:31 
GeneralRe: Search form problem Pin
phil.o19-Apr-12 0:35
professionalphil.o19-Apr-12 0:35 
Questionconvert large files into byte [] Pin
abbd18-Apr-12 8:27
abbd18-Apr-12 8:27 
AnswerRe: convert large files into byte [] Pin
jschell18-Apr-12 8:53
jschell18-Apr-12 8:53 
AnswerRe: convert large files into byte [] Pin
OriginalGriff18-Apr-12 9:22
mveOriginalGriff18-Apr-12 9:22 
QuestionLambda expression tree building [Solved - I think] Pin
wizardzz18-Apr-12 7:43
wizardzz18-Apr-12 7:43 
QuestionSelecting desktop icon Pin
MitchG92_2418-Apr-12 2:32
MitchG92_2418-Apr-12 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.