16,016,623 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Aria Jafarian (Top 21 by date)
Aria Jafarian
18-Jul-17 10:52am
View
Just thinking out loud, Shouldn't you put each generated number in a table and check if it exists or not in that table before using it?
Aria Jafarian
3-Mar-16 13:19pm
View
Definitely. We are just showing him the way. No code given.
Aria Jafarian
3-Mar-16 11:43am
View
You have two numbers fetched from user.
You need two for loops inside each other(nested loop) to multiply these numbers and write them to screen and one check for the result not being zero in the inner loop. Good luck.
Aria Jafarian
3-Mar-16 10:57am
View
Give us some data on your tables and their relationships.
My first question is why do you use so many nested select
statements? Common table Expressions (CTE) can help you on Readability.
Aria Jafarian
2-Mar-16 17:27pm
View
You have to use DateTime.ParseExact as indicated below
Aria Jafarian
29-Feb-16 14:16pm
View
All the code you have written is in Login button click.
Put a break point and see what is in your form load GlobalVariable.IsAdmin
Aria Jafarian
29-Feb-16 13:32pm
View
Where you check if your user is an Admin or Employee just add this
GlobalVariables.IsAdmin = True (obviously this is when your user is Admin)
I just added it for you in your code:
If dr.GetString(2) = "ADMIN" Then
GlobalVariables.IsAdmin = True
Me.Hide()
HomePage.Show()
ElseIf dr.GetString(2) = "EMPLOYEE" Then
GlobalVariables.IsAdmin = False
Me.Hide()
HomePage.Show()
and add this class to your project
Public Class GlobalVariables
Public Shared Property IsAdmin As bool
End Class
Then everywhere in your application you have access to GlobalVariables.IsAdmin
Aria Jafarian
29-Feb-16 13:06pm
View
Deleted
This is how I would do it.
You need to have a table in a database (or a text file)
Then on first screen when the user logs into you application
Based on the table you check whether he is an employee or admin
Then you save this to a global variable like isAdmin= True.
Then you need to have two forms one for employee and one to show to admin.
We don't do coding problems in this forum if you have any questions on the code you have written you can ask.
Aria Jafarian
29-Feb-16 11:10am
View
Check the solution for Global variables below.
Aria Jafarian
22-Feb-16 11:36am
View
Hi, What error do you get?
Put a breakpoint on the first line of code above(button click) and follow the debugger.
Just noticed, you don't need brackets in the commandText for your table name.
Take them out. cmd.CommandText = "select * from booking where BookingId = @BookingId";
Aria Jafarian
28-Jan-16 14:17pm
View
I didn't understand the question? Is it asp.net or native Android?
And as stated by Sinisa write the code and ask us for ideas.
Aria Jafarian
27-Jan-16 15:21pm
View
We are not talking about a guaranty,it is about the probability.
Each time you buy a lottery ticket the odds are the same never changes.(given the number of tickets sold are the same)
That's why we say unlikely.If odds for something is 1 in trillion there is no guaranty of that not happening but the probability is soooo small.
Aria Jafarian
27-Jan-16 13:38pm
View
Where did I say that the Guid is 100% unique?
I reiterate a colllision is highly unlikely.
Aria Jafarian
27-Jan-16 13:33pm
View
Deleted
In the link I provided there is a discussion against chopping the Guid.We are discussing the GUID collision here.And I 100% agree that the Guid produced should not be chopped. If he just wants six numbers he has to check for uniqueness himself.
Aria Jafarian
27-Jan-16 13:30pm
View
Yes poisoning the well falacy. Start generating Guids and show me a collision. I presented Eric Lippert's research you don't want to believe it show us how you got a collision.
Bear in mind the language you used is the sheer example of anti science bias.
Aria Jafarian
27-Jan-16 13:27pm
View
Deleted
Yes it would be unique with high likelihood for next 30 trillion years.
Aria Jafarian
27-Jan-16 13:06pm
View
Eric Lippert :
There are on the order 230 personal computers in the world (and of course lots of hand-held devices or non-PC computing devices that have more or less the same levels of computing power, but lets ignore those). Let's assume that we put all those PCs in the world to the task of generating GUIDs; if each one can generate, say, 220 GUIDs per second then after only about 272 seconds -- one hundred and fifty trillion years -- you'll have a very high chance of generating a collision with your specific GUID. And the odds of collision get pretty good after only thirty trillion years.
Aria Jafarian
27-Jan-16 12:48pm
View
Deleted
We'd better start teaching what unlikely means. There was a discussion about this on stackoverflow and most of the developers were having fun on how a collision might happen in Guid
Aria Jafarian
27-Jan-16 12:44pm
View
What kind of language is this?
The burdan of proof is on you, if you understand the concept.
Do you understand that the time stamp with the date is unique? And certainly I said it is unlikely.
Aria Jafarian
27-Jan-16 11:48am
View
Yes you can check for uniqueness yourself but haven't seen a collision reported in GUIDs. There was a discussion on stack and in a nutshell it is highly unlikely to see a collision because the time stamp is used in the generation of a GUID.
Aria Jafarian
27-Jan-16 11:42am
View
Improved the answer.
Show More