473,387 Members | 1,621 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,387 software developers and data experts.

ArrayList Function In Business Tier?

I have a webform in which when the user press generate button the form
generate six unique ramdon numbers, the user can also type these six numbers
in manually in any order. however, the user can also press a post button
that post these six numbers into the database. My problem is that these six
numbers need to be posted to the database from less to greatest, and all of
my code is within the business tier class not the code behind class.

After looking at my code below...
How do I create an ArrayList that can get the values from the Generate
function ("which include a stack") and pass to the form, and get the values
from the form and pass them to the database? **Please note where you see is
my problem. Thanks
Private Function Generate(ByVal Value As Integer) As Integer

Dim arrl(Value) As Integer

Dim x As Integer

Dim j As Integer

Dim s As Stack = New Stack

Dim blnexists As Boolean = True

For j = 0 To Value

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

While blnexists = True

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

End While

s.Push(arr1(j))

Next

For x = 0 To Value

arr1(x) = s.Pop()

Next
'Just Tried something did not work

'Dim I As Integer

'Dim pickNums As ArrayList = New ArrayList

'For I = 0 To PickCount

'pickNums.Add(arrl(I))

'Next

'GeneratePick = SortPick(pickNums)
End Function

'Just Tried something did not work

'Public Function SortPick(ByVal UserPick As ArrayList)

'UserPick.Sort()

'End Function

Nov 18 '05 #1
9 1393
Not sure what you want to do but here is a function that returns a sorted
stack of numberOfNumbers random numbers
cheers,
mortb

Private Function Generate(ByVal numberOfNumbers As Integer) As Stack
Dim al as ArrayList = new ArrayList(numberOfNumbers)
Dim rand as random = new Random()
for i as integer = 0 to numberOfNumbers
Dim rnd as integer = rand.Next()
while(al.Contains(rnd))
rnd = rand.Next()
end while
al.Add(rnd)
next
al.Sort()
Generate = new Stack(al)
End Function

pseudo code:
page_onload

stack = generate
textbox1 = (stack.pop)ToString()
textbox2 = (stack.pop)ToString()
..

end function

"Leon" <vn*****@msn.com> wrote in message
news:eU**************@TK2MSFTNGP15.phx.gbl...
I have a webform in which when the user press generate button the form
generate six unique ramdon numbers, the user can also type these six
numbers in manually in any order. however, the user can also press a post
button that post these six numbers into the database. My problem is that
these six numbers need to be posted to the database from less to greatest,
and all of my code is within the business tier class not the code behind
class.

After looking at my code below...
How do I create an ArrayList that can get the values from the Generate
function ("which include a stack") and pass to the form, and get the
values from the form and pass them to the database? **Please note where
you see is my problem. Thanks
Private Function Generate(ByVal Value As Integer) As Integer

Dim arrl(Value) As Integer

Dim x As Integer

Dim j As Integer

Dim s As Stack = New Stack

Dim blnexists As Boolean = True

For j = 0 To Value

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

While blnexists = True

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

End While

s.Push(arr1(j))

Next

For x = 0 To Value

arr1(x) = s.Pop()

Next
'Just Tried something did not work

'Dim I As Integer

'Dim pickNums As ArrayList = New ArrayList

'For I = 0 To PickCount

'pickNums.Add(arrl(I))

'Next

'GeneratePick = SortPick(pickNums)
End Function

'Just Tried something did not work

'Public Function SortPick(ByVal UserPick As ArrayList)

'UserPick.Sort()

'End Function

Nov 18 '05 #2
oops,
when the elements are added to the stack they are reversed to avoid this
insert
al.Reverse()
before
Generate = new Stack(al)

cheers,
mortb

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uI**************@TK2MSFTNGP09.phx.gbl...
Not sure what you want to do but here is a function that returns a sorted
stack of numberOfNumbers random numbers
cheers,
mortb

Private Function Generate(ByVal numberOfNumbers As Integer) As Stack
Dim al as ArrayList = new ArrayList(numberOfNumbers)
Dim rand as random = new Random()
for i as integer = 0 to numberOfNumbers
Dim rnd as integer = rand.Next()
while(al.Contains(rnd))
rnd = rand.Next()
end while
al.Add(rnd)
next
al.Sort()
Generate = new Stack(al)
End Function

pseudo code:
page_onload

stack = generate
textbox1 = (stack.pop)ToString()
textbox2 = (stack.pop)ToString()
..

end function

"Leon" <vn*****@msn.com> wrote in message
news:eU**************@TK2MSFTNGP15.phx.gbl...
I have a webform in which when the user press generate button the form
generate six unique ramdon numbers, the user can also type these six
numbers in manually in any order. however, the user can also press a post
button that post these six numbers into the database. My problem is that
these six numbers need to be posted to the database from less to greatest,
and all of my code is within the business tier class not the code behind
class.

After looking at my code below...
How do I create an ArrayList that can get the values from the Generate
function ("which include a stack") and pass to the form, and get the
values from the form and pass them to the database? **Please note where
you see is my problem. Thanks
Private Function Generate(ByVal Value As Integer) As Integer

Dim arrl(Value) As Integer

Dim x As Integer

Dim j As Integer

Dim s As Stack = New Stack

Dim blnexists As Boolean = True

For j = 0 To Value

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

While blnexists = True

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

End While

s.Push(arr1(j))

Next

For x = 0 To Value

arr1(x) = s.Pop()

Next
'Just Tried something did not work

'Dim I As Integer

'Dim pickNums As ArrayList = New ArrayList

'For I = 0 To PickCount

'pickNums.Add(arrl(I))

'Next

'GeneratePick = SortPick(pickNums)
End Function

'Just Tried something did not work

'Public Function SortPick(ByVal UserPick As ArrayList)

'UserPick.Sort()

'End Function


Nov 18 '05 #3
Thanks for your reply, but what I want to do is pass the randomly generated
numbers from the Generate function which is in the business tier to my
webform.
Do I need to declare the Generate function as a ArrayList or build a
separate ArrayList function or sub and pass the values from there to my
page?
OR....
How do I get the five generated number from this class which is in the
business tier to my webform?
See Code...
Private Function Generate(ByVal Value As Integer) As Integer
Dim arrl(Value) As Integer
Dim x As Integer
Dim j As Integer
Dim s As Stack = New Stack
Dim blnexists As Boolean = True
For j = 0 To Value
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
While blnexists = True
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
End While
s.Push(arr1(j))
Next
For x = 0 To Value
arr1(x) = s.Pop()
Next
End Function
"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:Oy**************@tk2msftngp13.phx.gbl...
oops,
when the elements are added to the stack they are reversed to avoid this
insert
al.Reverse()
before
Generate = new Stack(al)

cheers,
mortb

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:uI**************@TK2MSFTNGP09.phx.gbl...
Not sure what you want to do but here is a function that returns a sorted
stack of numberOfNumbers random numbers
cheers,
mortb

Private Function Generate(ByVal numberOfNumbers As Integer) As Stack
Dim al as ArrayList = new ArrayList(numberOfNumbers)
Dim rand as random = new Random()
for i as integer = 0 to numberOfNumbers
Dim rnd as integer = rand.Next()
while(al.Contains(rnd))
rnd = rand.Next()
end while
al.Add(rnd)
next
al.Sort()
Generate = new Stack(al)
End Function

pseudo code:
page_onload

stack = generate
textbox1 = (stack.pop)ToString()
textbox2 = (stack.pop)ToString()
..

end function

"Leon" <vn*****@msn.com> wrote in message
news:eU**************@TK2MSFTNGP15.phx.gbl...
I have a webform in which when the user press generate button the form
generate six unique ramdon numbers, the user can also type these six
numbers in manually in any order. however, the user can also press a post
button that post these six numbers into the database. My problem is that
these six numbers need to be posted to the database from less to
greatest, and all of my code is within the business tier class not the
code behind class.

After looking at my code below...
How do I create an ArrayList that can get the values from the Generate
function ("which include a stack") and pass to the form, and get the
values from the form and pass them to the database? **Please note where
you see is my problem. Thanks
Private Function Generate(ByVal Value As Integer) As Integer

Dim arrl(Value) As Integer

Dim x As Integer

Dim j As Integer

Dim s As Stack = New Stack

Dim blnexists As Boolean = True

For j = 0 To Value

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

While blnexists = True

arr1(j) = GetRandomNumber()

blnexists = s.Contains(arr1(j))

End While

s.Push(arr1(j))

Next

For x = 0 To Value

arr1(x) = s.Pop()

Next
'Just Tried something did not work

'Dim I As Integer

'Dim pickNums As ArrayList = New ArrayList

'For I = 0 To PickCount

'pickNums.Add(arrl(I))

'Next

'GeneratePick = SortPick(pickNums)
End Function

'Just Tried something did not work

'Public Function SortPick(ByVal UserPick As ArrayList)

'UserPick.Sort()

'End Function



Nov 18 '05 #4
Like this (pseudo code not compiled)?
Page code behind:

submit onclick:

Dim userRandomNumbers as ArrayList = new ArrayList()
if userRnd1.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd1.Text.Trim ())) ' Assuming there
are text fields for the random numbers
end if
if userRnd2.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd2.Text.Trim ()))
end if
....

' if the generate would return an arraylist of x random numbers:
int x = 6 - userRandomNumbers.Count
userRandomNumbers.AddRange(BusinessObject.Generate (x))
userRandomNumbers.Sort()

'if you want to display the resulting numbers on your webform:
userRnd1.Text.= userRandomNumbers[0]
userRnd2.Text.= userRandomNumbers[1]
....

' code that post data to database goes here...

"Leon" <vn*****@msn.com> wrote in message
news:O%***************@TK2MSFTNGP12.phx.gbl...
Thanks for your reply, but what I want to do is pass the randomly
generated numbers from the Generate function which is in the business tier
to my webform.
Do I need to declare the Generate function as a ArrayList or build a
separate ArrayList function or sub and pass the values from there to my
page?
OR....
How do I get the five generated number from this class which is in the
business tier to my webform?

Nov 18 '05 #5
Thanks For all the help, but this is my code and it runs but it only return
one value to the textbox and I know the other values exist because I step
inside of my code. what do you see that I'm doing wrong. thanks again!!!

Private Function Generate(ByVal Value As Integer) As ArrayList
Dim arrl(Value) As Integer
Dim x As Integer
Dim j As Integer
Dim s As Stack = New Stack
Dim blnexists As Boolean = True
For j = 0 To Value
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
While blnexists = True
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
End While
s.Push(arr1(j))
Next
For x = 0 To Value
arr1(x) = s.Pop()
Next
Dim I As Integer
Dim UserNum As ArrayList = New ArrayList
For I = 0 To Value
UserNum.Add(arr1(I))
Next
Generate= New ArrayList(UserNum)
End Function

And then this code is in my code behind class...............

Dim test As ArrayList
test = newPick.GeneratePick(5)

Me.TextBox1.Text = test.Item(0)
Me.TextBox1.Text = test.Item(1)
Me.TextBox1.Text = test.Item(2)
Me.TextBox1.Text = test.Item(3)
Me.TextBox1.Text = test.Item(4)
Me.TextBox1.Text = test.Item(5)

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP10.phx.gbl...
Like this (pseudo code not compiled)?
Page code behind:

submit onclick:

Dim userRandomNumbers as ArrayList = new ArrayList()
if userRnd1.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd1.Text.Trim ())) ' Assuming there
are text fields for the random numbers
end if
if userRnd2.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd2.Text.Trim ()))
end if
...

' if the generate would return an arraylist of x random numbers:
int x = 6 - userRandomNumbers.Count
userRandomNumbers.AddRange(BusinessObject.Generate (x))
userRandomNumbers.Sort()

'if you want to display the resulting numbers on your webform:
userRnd1.Text.= userRandomNumbers[0]
userRnd2.Text.= userRandomNumbers[1]
...

' code that post data to database goes here...

"Leon" <vn*****@msn.com> wrote in message
news:O%***************@TK2MSFTNGP12.phx.gbl...
Thanks for your reply, but what I want to do is pass the randomly
generated numbers from the Generate function which is in the business
tier to my webform.
Do I need to declare the Generate function as a ArrayList or build a
separate ArrayList function or sub and pass the values from there to my
page?
OR....
How do I get the five generated number from this class which is in the
business tier to my webform?


Nov 18 '05 #6
If the numbers are there when you step into the code then the problem has to
be somwhere else -- somewhere in the code that you haven't posted.

By the way, why do you create a stack? and an array? It seems you only need
the array list which you return...

cheers,
mortb

Private Function Generate(ByVal Value As Integer) As ArrayList
Dim arrl As ArrayList(Value)
For j = 0 To Value
Dim rnd as integer = GetRandomNumber()
While arrl.Contains(rnd)
rnd = GetRandomNumber()
End While
arrl .Add(rnd)
Next
Generate = arrl
End Function
"Leon" <vn*****@msn.com> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
Thanks For all the help, but this is my code and it runs but it only
return one value to the textbox and I know the other values exist because
I step inside of my code. what do you see that I'm doing wrong. thanks
again!!!

Private Function Generate(ByVal Value As Integer) As ArrayList
Dim arrl(Value) As Integer
Dim x As Integer
Dim j As Integer
Dim s As Stack = New Stack
Dim blnexists As Boolean = True
For j = 0 To Value
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
While blnexists = True
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
End While
s.Push(arr1(j))
Next
For x = 0 To Value
arr1(x) = s.Pop()
Next
Dim I As Integer
Dim UserNum As ArrayList = New ArrayList
For I = 0 To Value
UserNum.Add(arr1(I))
Next
Generate= New ArrayList(UserNum)
End Function

And then this code is in my code behind class...............

Dim test As ArrayList
test = newPick.GeneratePick(5)

Me.TextBox1.Text = test.Item(0)
Me.TextBox1.Text = test.Item(1)
Me.TextBox1.Text = test.Item(2)
Me.TextBox1.Text = test.Item(3)
Me.TextBox1.Text = test.Item(4)
Me.TextBox1.Text = test.Item(5)

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP10.phx.gbl...
Like this (pseudo code not compiled)?
Page code behind:

submit onclick:

Dim userRandomNumbers as ArrayList = new ArrayList()
if userRnd1.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd1.Text.Trim ())) ' Assuming
there are text fields for the random numbers
end if
if userRnd2.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd2.Text.Trim ()))
end if
...

' if the generate would return an arraylist of x random numbers:
int x = 6 - userRandomNumbers.Count
userRandomNumbers.AddRange(BusinessObject.Generate (x))
userRandomNumbers.Sort()

'if you want to display the resulting numbers on your webform:
userRnd1.Text.= userRandomNumbers[0]
userRnd2.Text.= userRandomNumbers[1]
...

' code that post data to database goes here...

"Leon" <vn*****@msn.com> wrote in message
news:O%***************@TK2MSFTNGP12.phx.gbl...
Thanks for your reply, but what I want to do is pass the randomly
generated numbers from the Generate function which is in the business
tier to my webform.
Do I need to declare the Generate function as a ArrayList or build a
separate ArrayList function or sub and pass the values from there to my
page?
OR....
How do I get the five generated number from this class which is in the
business tier to my webform?



Nov 18 '05 #7
I use the stack just to make sure I get 5 unique random number back.
however, what I sent was all the code and what I meant by say "the number
are there when I step into my project is the numbers are in the stack, but
it only sends one value back to the calling function ArrayList. maybe I can
change the stack to ArrayList but my biggest problem is getting from the
Generate Function ArrayList to my textboxes in my webform on button click.

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
If the numbers are there when you step into the code then the problem has
to be somwhere else -- somewhere in the code that you haven't posted.

By the way, why do you create a stack? and an array? It seems you only
need the array list which you return...

cheers,
mortb

Private Function Generate(ByVal Value As Integer) As ArrayList
Dim arrl As ArrayList(Value)
For j = 0 To Value
Dim rnd as integer = GetRandomNumber()
While arrl.Contains(rnd)
rnd = GetRandomNumber()
End While
arrl .Add(rnd)
Next
Generate = arrl
End Function
"Leon" <vn*****@msn.com> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
Thanks For all the help, but this is my code and it runs but it only
return one value to the textbox and I know the other values exist because
I step inside of my code. what do you see that I'm doing wrong. thanks
again!!!

Private Function Generate(ByVal Value As Integer) As ArrayList
Dim arrl(Value) As Integer
Dim x As Integer
Dim j As Integer
Dim s As Stack = New Stack
Dim blnexists As Boolean = True
For j = 0 To Value
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
While blnexists = True
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
End While
s.Push(arr1(j))
Next
For x = 0 To Value
arr1(x) = s.Pop()
Next
Dim I As Integer
Dim UserNum As ArrayList = New ArrayList
For I = 0 To Value
UserNum.Add(arr1(I))
Next
Generate= New ArrayList(UserNum)
End Function

And then this code is in my code behind class...............

Dim test As ArrayList
test = newPick.GeneratePick(5)

Me.TextBox1.Text = test.Item(0)
Me.TextBox1.Text = test.Item(1)
Me.TextBox1.Text = test.Item(2)
Me.TextBox1.Text = test.Item(3)
Me.TextBox1.Text = test.Item(4)
Me.TextBox1.Text = test.Item(5)

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP10.phx.gbl...
Like this (pseudo code not compiled)?
Page code behind:

submit onclick:

Dim userRandomNumbers as ArrayList = new ArrayList()
if userRnd1.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd1.Text.Trim ())) ' Assuming
there are text fields for the random numbers
end if
if userRnd2.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd2.Text.Trim ()))
end if
...

' if the generate would return an arraylist of x random numbers:
int x = 6 - userRandomNumbers.Count
userRandomNumbers.AddRange(BusinessObject.Generate (x))
userRandomNumbers.Sort()

'if you want to display the resulting numbers on your webform:
userRnd1.Text.= userRandomNumbers[0]
userRnd2.Text.= userRandomNumbers[1]
...

' code that post data to database goes here...

"Leon" <vn*****@msn.com> wrote in message
news:O%***************@TK2MSFTNGP12.phx.gbl...
Thanks for your reply, but what I want to do is pass the randomly
generated numbers from the Generate function which is in the business
tier to my webform.
Do I need to declare the Generate function as a ArrayList or build a
separate ArrayList function or sub and pass the values from there to my
page?
OR....
How do I get the five generated number from this class which is in the
business tier to my webform?



Nov 18 '05 #8
Thanks for all the help I got it. LOOK! in the code I posted all the
textboxes was the same name so all the values went to that textbox.

Me.TextBox1.Text = test.Item(0)
Me.TextBox1.Text = test.Item(1)
Me.TextBox1.Text = test.Item(2)
Me.TextBox1.Text = test.Item(3)
Me.TextBox1.Text = test.Item(4)
Me.TextBox1.Text = test.Item(5)

"Leon" <vn*****@msn.com> wrote in message
news:ui**************@TK2MSFTNGP10.phx.gbl...
I use the stack just to make sure I get 5 unique random number back.
however, what I sent was all the code and what I meant by say "the number
are there when I step into my project is the numbers are in the stack, but
it only sends one value back to the calling function ArrayList. maybe I can
change the stack to ArrayList but my biggest problem is getting from the
Generate Function ArrayList to my textboxes in my webform on button click.

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:u1**************@TK2MSFTNGP12.phx.gbl...
If the numbers are there when you step into the code then the problem has
to be somwhere else -- somewhere in the code that you haven't posted.

By the way, why do you create a stack? and an array? It seems you only
need the array list which you return...

cheers,
mortb

Private Function Generate(ByVal Value As Integer) As ArrayList
Dim arrl As ArrayList(Value)
For j = 0 To Value
Dim rnd as integer = GetRandomNumber()
While arrl.Contains(rnd)
rnd = GetRandomNumber()
End While
arrl .Add(rnd)
Next
Generate = arrl
End Function
"Leon" <vn*****@msn.com> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...
Thanks For all the help, but this is my code and it runs but it only
return one value to the textbox and I know the other values exist
because I step inside of my code. what do you see that I'm doing wrong.
thanks again!!!

Private Function Generate(ByVal Value As Integer) As ArrayList
Dim arrl(Value) As Integer
Dim x As Integer
Dim j As Integer
Dim s As Stack = New Stack
Dim blnexists As Boolean = True
For j = 0 To Value
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
While blnexists = True
arr1(j) = GetRandomNumber()
blnexists = s.Contains(arr1(j))
End While
s.Push(arr1(j))
Next
For x = 0 To Value
arr1(x) = s.Pop()
Next
Dim I As Integer
Dim UserNum As ArrayList = New ArrayList
For I = 0 To Value
UserNum.Add(arr1(I))
Next
Generate= New ArrayList(UserNum)
End Function

And then this code is in my code behind class...............

Dim test As ArrayList
test = newPick.GeneratePick(5)

Me.TextBox1.Text = test.Item(0)
Me.TextBox1.Text = test.Item(1)
Me.TextBox1.Text = test.Item(2)
Me.TextBox1.Text = test.Item(3)
Me.TextBox1.Text = test.Item(4)
Me.TextBox1.Text = test.Item(5)

"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:OM**************@TK2MSFTNGP10.phx.gbl...
Like this (pseudo code not compiled)?
Page code behind:

submit onclick:

Dim userRandomNumbers as ArrayList = new ArrayList()
if userRnd1.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd1.Text.Trim ())) ' Assuming
there are text fields for the random numbers
end if
if userRnd2.Text.Trim() != ""
userRandomNumbers.Add(int.Parse(userRnd2.Text.Trim ()))
end if
...

' if the generate would return an arraylist of x random numbers:
int x = 6 - userRandomNumbers.Count
userRandomNumbers.AddRange(BusinessObject.Generate (x))
userRandomNumbers.Sort()

'if you want to display the resulting numbers on your webform:
userRnd1.Text.= userRandomNumbers[0]
userRnd2.Text.= userRandomNumbers[1]
...

' code that post data to database goes here...

"Leon" <vn*****@msn.com> wrote in message
news:O%***************@TK2MSFTNGP12.phx.gbl...
> Thanks for your reply, but what I want to do is pass the randomly
> generated numbers from the Generate function which is in the business
> tier to my webform.
> Do I need to declare the Generate function as a ArrayList or build a
> separate ArrayList function or sub and pass the values from there to
> my page?
> OR....
> How do I get the five generated number from this class which is in the
> business tier to my webform?



Nov 18 '05 #9
Most small errors...so easy to miss and yet so obvious...we've all been
there :)

"Leon" <vn*****@msn.com> wrote in message
news:OB**************@TK2MSFTNGP10.phx.gbl...
Thanks for all the help I got it. LOOK! in the code I posted all the
textboxes was the same name so all the values went to that textbox.

Me.TextBox1.Text = test.Item(0)
Me.TextBox1.Text = test.Item(1)
Me.TextBox1.Text = test.Item(2)
Me.TextBox1.Text = test.Item(3)
Me.TextBox1.Text = test.Item(4)
Me.TextBox1.Text = test.Item(5)

Nov 18 '05 #10

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

Similar topics

0
by: Leon | last post by:
**I don't care if the solution is in C#!!!!! I have a webform in which when the user press generate button the form generate six unique ramdon numbers, the user can also type these six numbers...
5
by: G. Stewart | last post by:
The word "Business" in the term implies some sort of commercial aspects or connotations. But from what I can see, that is not necesserially the case at all? So what is the reasoning behind the...
8
by: Keith-Earl | last post by:
Okay, looking for a Best Practice. We are building a classic three tier app in VB.NET. When we load up a WebForm we have access to very useful objects such as the Session object. We frequently...
1
by: sd | last post by:
QUESTION: How can my ASP page - which uses language="VBScript" - pass a "System.Collections.ArrayList" object - as a parameter - to a C# method in the middle-tier ??? ----- Is it possible at...
0
by: Leon | last post by:
I have a webform in which when the user press generate button the form generate six unique ramdon numbers, the user can also type these six numbers in manually in any order. however, the user can...
18
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
1
by: Nemisis | last post by:
Hi everyone, We are currently re-developing our software, to asp.net 2.0 and taking a 3 tier architecture. I have been thinking about it, and i think that it belongs in the business tier. ...
4
by: pratham | last post by:
Hi! I'm making a database application and i heard from a friend that it is more proffecional and easy to do this with bussines objects. Can anyone tell me where i can find more info on bussines...
2
by: grawsha2000 | last post by:
Greetings, I am developing this N-tier business app. The problem I'm facing is when I try to pass business objects (employees, dept..etc) from business tier to data tier,i.e., the add method in...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.