Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > random number

Reply
Thread Tools

random number

 
 
isaac2004
Guest
Posts: n/a
 
      02-11-2006
hi how would you go changing a random number generated into a item
drawn from a database with SQL

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      02-11-2006
isaac2004 wrote on 11 feb 2006 in microsoft.public.inetserver.asp.general:

> hi how would you go changing a random number generated into a item
> drawn from a database with SQL


You mean having a variable filled with a random number,
and then filling that variable with the value of a database field?

It wouldn't be random then?


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
isaac2004
Guest
Posts: n/a
 
      02-11-2006
no having a random item be generated to a page. the items are on the
database and using SQL to generate a random item name using the
Randomize function

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-11-2006
isaac2004 wrote on 12 feb 2006 in microsoft.public.inetserver.asp.general:

> no having a random item be generated to a page. the items are on the
> database and using SQL to generate a random item name using the
> Randomize function
>


Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the article
headers. <http://www.safalra.com/special/googlegroupsreply/>

==============================

I still do not understand what you are asking, Isaak

What is a "generated random item"?
And you have no[t] genreated it to(?) a page?

Tell us about the type and content of your databse, and show us the
relevand ASP code, you have come up with so far.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
isaac2004
Guest
Posts: n/a
 
      02-12-2006
my database consists of two tables one vendors and other Items, i want
to have a page on my site that when viewed a random item is displayed
such as


Today we have a sale on Tight Fit Denim jeans by Polo
----------------------------------->
this is the random item
the item is randomly generated by a randomizer that picks the item name
out of the database and displays the item name, item type, and price

i use this code

randomize
intItemID = Int(22* rnd(1)) +1
for the random but i dont know how to convert the random number into
the item type. this is for my asp class, if you want a working example,
go here

http://yorktown.cbe.wwu.edu/sandvig/...RandomItem.asp

thanks for the help

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-12-2006
isaac2004 wrote on 12 feb 2006 in microsoft.public.inetserver.asp.general:

> my database consists of two tables


If you persist neglecting usenet netiquette by not quoting,
even when politely asked,
I will stop anwering you on your topic.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
isaac2004
Guest
Posts: n/a
 
      02-12-2006
>If you persist neglecting usenet netiquette by not quoting,
even when politely asked,
I will stop anwering you on your topic.

sorry i forgot

>I still do not understand what you are asking, Isaak



>What is a "generated random item"?

And you have no[t] genreated it to(?) a page?


>Tell us about the type and content of your databse, and show us the

relevand ASP code, you have come up with so far.

my database consists of two tables one vendors and other Items, i want
to have a page on my site that when viewed a random item is displayed
such as

Today we have a sale on Tight Fit Denim jeans by Polo
----------------------------------->
this is the random item
the item is randomly generated by a randomizer that picks the item name

out of the database and displays the item name, item type, and price


i use this code


randomize
intItemID = Int(22* rnd(1)) +1
for the random but i dont know how to convert the random number into
the item type. this is for my asp class, if you want a working example,

go here


http://yorktown.cbe.wwu.edu/sandvig/...SQL/RandomItem...



thanks for the help

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-12-2006
isaac2004 wrote on 12 feb 2006 in microsoft.public.inetserver.asp.general:

> randomize
> intItemID = Int(22* rnd(1)) +1
> for the random but i dont know how to convert the random number into
> the item type. this is for my asp class, if you want a working example,
>


SQL = "SELECT * from tblX WHERE ID = " & intItemID

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
isaac2004
Guest
Posts: n/a
 
      02-12-2006
>SQL = "SELECT * from tblX WHERE ID = " & intItemID

doesnt this code just source from the databse but not put it through a
random number generator

 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      02-12-2006
isaac2004 wrote on 12 feb 2006 in microsoft.public.inetserver.asp.general:

>>SQL = "SELECT * from tblX WHERE ID = " & intItemID

>
> doesnt this code just source from the databse but not put it through a
> random number generator
>


No, you came up with the random number generator, remember:

>> randomize
>> intItemID = Int(22* rnd(1)) +1


so intItemID was defined.

Please do not use inconclusive terminology like "just source from"

Better show us the code you have so far.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Math.random() and Math.round(Math.random()) and Math.floor(Math.random()*2) VK Javascript 15 05-02-2010 03:43 PM
How do I get a random number between two random numbers? Alex Untitled Ruby 11 11-16-2009 09:45 AM
random.random(), random not defined!? globalrev Python 4 04-20-2008 08:12 AM
OT: Number Nine, Number Nine, Number Nine FrisbeeŽ MCSE 37 09-26-2005 04:06 PM
My random number is only random for the first run??? xeys_00 C++ 12 04-11-2005 03:58 PM



Advertisments