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

Guest Account

I want to have 2 types of accounts of which users can use to login through
the site, either a user account that is created through registeration or
login as a guest.

I have no problem with the user accounts, the problem is with guest account,
I want if a user chooses to login as a guest he would be given a random 5
digit id that does not currently exist in the guests table. I don't want to
have the auto increment primary key in guests table, I want it random created
in the page and then inserted in the table.

I can't think of a solution that generates random values that guarantees
that no duplicate values would exist at the same time?

Any one can help me with an idea?

Thanks in advance.
Nov 19 '05 #1
2 2989
Try using tickcount, I think it operates at the millisecond level which
should be unique enough.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"JessyEzzy" <Je*******@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
I want to have 2 types of accounts of which users can use to login through
the site, either a user account that is created through registeration or
login as a guest.

I have no problem with the user accounts, the problem is with guest
account,
I want if a user chooses to login as a guest he would be given a random 5
digit id that does not currently exist in the guests table. I don't want
to
have the auto increment primary key in guests table, I want it random
created
in the page and then inserted in the table.

I can't think of a solution that generates random values that guarantees
that no duplicate values would exist at the same time?

Any one can help me with an idea?

Thanks in advance.

Nov 19 '05 #2
I tried something like that:
new Random().Next((int)DateTime.Now.Ticks)
is this correct?

"John Timney (ASP.NET MVP)" wrote:
Try using tickcount, I think it operates at the millisecond level which
should be unique enough.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"JessyEzzy" <Je*******@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
I want to have 2 types of accounts of which users can use to login through
the site, either a user account that is created through registeration or
login as a guest.

I have no problem with the user accounts, the problem is with guest
account,
I want if a user chooses to login as a guest he would be given a random 5
digit id that does not currently exist in the guests table. I don't want
to
have the auto increment primary key in guests table, I want it random
created
in the page and then inserted in the table.

I can't think of a solution that generates random values that guarantees
that no duplicate values would exist at the same time?

Any one can help me with an idea?

Thanks in advance.


Nov 19 '05 #3

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

Similar topics

1
by: sumon | last post by:
hi , I want to create a guest book using php .It includes name ,email,comments field . But if name is like ab'hh or comment has " ..then it creates problem .. I want to know is there any function...
2
by: Ted Ward | last post by:
Hi all. I have MySQL 4.0.18 and phpMyAdmin running on a FreeBSD box. The other day a student told me he logged on to my phpMyAdmin by specifying "guest" as the user and no password. I don't have a...
1
by: Audrey2 | last post by:
Nel database "master" ho mappato, per errore, l'utente "guest" su un utente sql "XXX" creato in SQLServer. Questo tipo di impostazione non permette pił di aver accesso con l'utente anonimo "guest"...
0
by: Dr. Strangedub | last post by:
I am looking for information on changing a configured Direct Connection (that uses RAS via serial port) via a C# Windows program. I want to change back and forth between Host and Guest (i.e.,...
1
by: Florimond | last post by:
Can I use osql to known the database install on a server via 'guest' account ? I had over 300 servers with sql server all around France (different version : 6.5, 7 and 8) I need to check all...
0
by: Justin | last post by:
Does anyone know how to determine if the guest account is disabled on a remote computer on the server? I was thinking I could read a registry key to do it, but I do not know if such a key exists....
2
by: Cleyton | last post by:
Hello! Someone knows how I can solve it: I've installed my program in administrator account for all users. But i've tried to run in guest account, my program returned fatal error, and it didn't...
0
by: Cleyton | last post by:
Hello! Someone knows what is happening?... My program doesn't work running in guest account. My program is registrated in msconfig and starts with windows...Ok... So, it stays waiting for a...
1
by: sravani1 | last post by:
plz tell that how to connect the google map in our guest book . Give some logic how to use map in my guest book.
0
by: Krishna | last post by:
I have no knowledge of MS SQL server or .net development. I have visual studio express installed on my system. I would like the guest account to be used to learn the development work. It seems...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.