Click here to Skip to main content
15,891,136 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 0:49
Pavlex47-Dec-16 0:49 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 1:04
professionalEddy Vluggen7-Dec-16 1:04 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 1:07
Pavlex47-Dec-16 1:07 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 1:12
professionalEddy Vluggen7-Dec-16 1:12 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 1:14
Pavlex47-Dec-16 1:14 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 2:49
professionalEddy Vluggen7-Dec-16 2:49 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 8:51
Pavlex47-Dec-16 8:51 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen7-Dec-16 9:31
professionalEddy Vluggen7-Dec-16 9:31 
Pavlex4 wrote:
I add ORDER BY RAND() but I won't show random word other time!!!
I am not even sure whether that is the correct syntax, but assuming it is, there are some other points as well;

You're SELECTing *, which means "all columns from that table". You stated that you want "one random word from the database", which is what the method ExecuteScalar returns. One value, not all rows.

If you are sure that the statement is correct and that it orders randomly, than selecting the TOP 1 record would also limit the amount of records returned.

If you have that working, than also use a using construct on the command object Smile | :)

Once that is fixed, only the statement remains as a possible point of failure. So, if you have this working tomorrow, you'd nearly be there. Compliments for persistence and perseverance Thumbs Up | :thumbsup:
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 10:29
Pavlex47-Dec-16 10:29 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 11:43
Pavlex47-Dec-16 11:43 
GeneralRe: Convert VB to C# Pin
Pavlex47-Dec-16 21:31
Pavlex47-Dec-16 21:31 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen8-Dec-16 3:02
professionalEddy Vluggen8-Dec-16 3:02 
GeneralRe: Convert VB to C# Pin
Pavlex48-Dec-16 7:55
Pavlex48-Dec-16 7:55 
GeneralRe: Convert VB to C# Pin
Pavlex48-Dec-16 12:27
Pavlex48-Dec-16 12:27 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen9-Dec-16 2:59
professionalEddy Vluggen9-Dec-16 2:59 
GeneralRe: Convert VB to C# Pin
Pavlex49-Dec-16 7:28
Pavlex49-Dec-16 7:28 
GeneralRe: Convert VB to C# Pin
Eddy Vluggen9-Dec-16 7:58
professionalEddy Vluggen9-Dec-16 7:58 
QuestionEquals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele12329-Nov-16 4:29
Cvele12329-Nov-16 4:29 
QuestionRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
ZurdoDev29-Nov-16 6:20
professionalZurdoDev29-Nov-16 6:20 
AnswerRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele12329-Nov-16 6:28
Cvele12329-Nov-16 6:28 
AnswerRe: Equals/Comparison of the two objects in which the property of the list(as object) Pin
Cvele1239-Dec-16 2:05
Cvele1239-Dec-16 2:05 
QuestionWhy the picture not save correctly if I change from button click to form load Pin
Munirah Malik28-Nov-16 15:46
Munirah Malik28-Nov-16 15:46 
AnswerRe: Why the picture not save correctly if I change from button click to form load Pin
Peter Leow28-Nov-16 17:57
professionalPeter Leow28-Nov-16 17:57 
QuestionFolder traverse in vbscript Pin
Member 126754628-Nov-16 0:17
Member 126754628-Nov-16 0:17 
AnswerRe: Folder traverse in vbscript Pin
Richard MacCutchan28-Nov-16 0:39
mveRichard MacCutchan28-Nov-16 0:39 

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.