Click here to Skip to main content
15,918,516 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to get the control properties into xml file Pin
Tom Deketelaere3-Oct-07 0:18
professionalTom Deketelaere3-Oct-07 0:18 
AnswerRe: How to get the control properties into xml file Pin
Dave Kreskowiak3-Oct-07 3:58
mveDave Kreskowiak3-Oct-07 3:58 
GeneralRe: How to get the control properties into xml file Pin
VB 8.05-Oct-07 0:26
VB 8.05-Oct-07 0:26 
Questionwindows service Pin
IETaxguard2-Oct-07 23:31
IETaxguard2-Oct-07 23:31 
AnswerRe: windows service Pin
Dave Kreskowiak3-Oct-07 3:48
mveDave Kreskowiak3-Oct-07 3:48 
GeneralRe: windows service Pin
IETaxguard3-Oct-07 4:03
IETaxguard3-Oct-07 4:03 
GeneralRe: windows service Pin
Dave Kreskowiak3-Oct-07 4:29
mveDave Kreskowiak3-Oct-07 4:29 
QuestionEunice Pin
Eunice (VB junior)2-Oct-07 23:23
Eunice (VB junior)2-Oct-07 23:23 
I have a problem on the below random codes. The codes are actually working. But sometime it just hang after clicked on the randomise button. (I suspect it kept looping at (while loop) to search for random number. Can it be??)Can anyone help me? Here are my codes.

Private oQuestionCount As Integer = 5
Private sQuestionCount As Integer = 2

Dim tQuestion As Integer = ds.Tables("FilteredQuestion").Rows.Count
Dim aSize As Integer
If Me.cbQuesType.Text = "Obj" Then
aSize = oQuestionCount
Else
aSize = sQuestionCount
End If

If tQuestion = 0 And tQuestion < aSize Then
MessageBox.Show("The questions from the Question Bank is not enough")
Me.Dispose()
End If

Dim rnd = New Random
Dim irnd As Integer
Dim arnd(aSize - 1) As Integer
Dim aID(aSize - 1) As Integer
Dim i As Integer
Dim sID As String
Dim iStudentCount As Integer

Randomize()
For i = 0 To aSize - 1
irnd = rnd.Next(0, tQuestion - 1)
Do While Array.IndexOf(arnd, irnd) > -1
irnd = rnd.next(0, aSize - 1)
Loop
arnd(i) = irnd
aID(i) = ds.Tables("FilteredQuestion").Rows(irnd)(0)
If i = aSize - 1 Then
sID = sID & aID(i)
Else
sID = sID & aID(i) & ","
End If
Next

Thanks ....
AnswerRe: Eunice Pin
Christian Graus2-Oct-07 23:41
protectorChristian Graus2-Oct-07 23:41 
Generalrandom bug.... how to solve? Pin
Eunice (VB junior)3-Oct-07 14:27
Eunice (VB junior)3-Oct-07 14:27 
QuestionWhere's Refractor? Pin
blackjack21502-Oct-07 23:06
blackjack21502-Oct-07 23:06 
AnswerRe: Where's Refractor? Pin
Christian Graus2-Oct-07 23:19
protectorChristian Graus2-Oct-07 23:19 
GeneralRe: Where's Refractor? Pin
blackjack21502-Oct-07 23:47
blackjack21502-Oct-07 23:47 
QuestionTextbox Vlidation Pin
Ursrathi2-Oct-07 22:32
Ursrathi2-Oct-07 22:32 
AnswerRe: Textbox Vlidation Pin
Christian Graus2-Oct-07 23:17
protectorChristian Graus2-Oct-07 23:17 
GeneralRe: Textbox Vlidation Pin
C1AllenS2-Oct-07 23:45
C1AllenS2-Oct-07 23:45 
GeneralRe: Textbox Vlidation Pin
Christian Graus2-Oct-07 23:55
protectorChristian Graus2-Oct-07 23:55 
GeneralRe: Textbox Vlidation Pin
nishkarsh_k3-Oct-07 0:24
nishkarsh_k3-Oct-07 0:24 
Questionsearch in vb 2005 Pin
apaisaloi2-Oct-07 22:11
apaisaloi2-Oct-07 22:11 
AnswerRe: search in vb 2005 Pin
Christian Graus2-Oct-07 23:18
protectorChristian Graus2-Oct-07 23:18 
Questionfor...next loop Pin
apaisaloi2-Oct-07 22:10
apaisaloi2-Oct-07 22:10 
AnswerRe: for...next loop Pin
Christian Graus2-Oct-07 23:19
protectorChristian Graus2-Oct-07 23:19 
AnswerRe: for...next loop Pin
Janani Divya3-Oct-07 1:34
Janani Divya3-Oct-07 1:34 
AnswerRe: Listview Pin
ESTAN2-Oct-07 22:42
ESTAN2-Oct-07 22:42 
QuestionPerformance counters Pin
ChandraRam2-Oct-07 21:12
ChandraRam2-Oct-07 21:12 

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.