Click here to Skip to main content
15,887,444 members
Home / Discussions / C#
   

C#

 
QuestionC# Exclusive Hid control Pin
Member 1263262215-Dec-16 22:16
Member 1263262215-Dec-16 22:16 
AnswerRe: C# Exclusive Hid control Pin
Richard MacCutchan15-Dec-16 22:19
mveRichard MacCutchan15-Dec-16 22:19 
GeneralRe: C# Exclusive Hid control Pin
Member 1263262215-Dec-16 22:42
Member 1263262215-Dec-16 22:42 
GeneralRe: C# Exclusive Hid control Pin
Richard MacCutchan15-Dec-16 22:54
mveRichard MacCutchan15-Dec-16 22:54 
AnswerRe: C# Exclusive Hid control Pin
Rob Philpott16-Dec-16 2:59
Rob Philpott16-Dec-16 2:59 
QuestionRandomly Pin
khalid khalidos15-Dec-16 3:10
khalid khalidos15-Dec-16 3:10 
AnswerRe: Randomly Pin
Richard MacCutchan15-Dec-16 3:38
mveRichard MacCutchan15-Dec-16 3:38 
AnswerRe: Randomly Pin
Afzaal Ahmad Zeeshan15-Dec-16 6:10
professionalAfzaal Ahmad Zeeshan15-Dec-16 6:10 
You really do need to use Random class's function to get a random value in a limit.
C#
var randomValue = new Random().Next(1, 100); // 56?
Random.Next Method (Int32, Int32) (System)[^]

You will then use this value in the SELECT query, to select that random question. While doing so, do remember to parametrize your query. Otherwise it may be exposed to SQL Injection.
SqlCommand.Parameters Property (System.Data.SqlClient)[^]

The working of this is clearly explained in the Bakery Sample of ASP.NET web sites template in WebMatrix tool. You can look for an example there, that works well.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

AnswerRe: Randomly PinPopular
Eddy Vluggen15-Dec-16 8:49
professionalEddy Vluggen15-Dec-16 8:49 
GeneralRe: Randomly Pin
Mycroft Holmes15-Dec-16 13:59
professionalMycroft Holmes15-Dec-16 13:59 
GeneralRe: Randomly Pin
Eddy Vluggen16-Dec-16 3:51
professionalEddy Vluggen16-Dec-16 3:51 
AnswerRe: Randomly Pin
Patrice T15-Dec-16 12:27
mvePatrice T15-Dec-16 12:27 
Questionhow to create dropdownlist to select country than state is automaticaly selected Pin
Member 1290578714-Dec-16 22:40
Member 1290578714-Dec-16 22:40 
AnswerRe: how to create dropdownlist to select country than state is automaticaly selected Pin
OriginalGriff14-Dec-16 22:46
mveOriginalGriff14-Dec-16 22:46 
QuestionConvert .mats file into .text file with unicode encoding Pin
ERAJEET8813-Dec-16 20:12
ERAJEET8813-Dec-16 20:12 
QuestionRe: Convert .mats file into .text file with unicode encoding Pin
Richard MacCutchan13-Dec-16 22:07
mveRichard MacCutchan13-Dec-16 22:07 
AnswerRe: Convert .mats file into .text file with unicode encoding Pin
Jochen Arndt13-Dec-16 22:38
professionalJochen Arndt13-Dec-16 22:38 
QuestionPascal to C# Convert Pin
Pavlex413-Dec-16 7:59
Pavlex413-Dec-16 7:59 
AnswerRe: Pascal to C# Convert Pin
Richard Deeming13-Dec-16 8:06
mveRichard Deeming13-Dec-16 8:06 
GeneralRe: Pascal to C# Convert Pin
Pavlex413-Dec-16 8:12
Pavlex413-Dec-16 8:12 
AnswerRe: Pascal to C# Convert Pin
OriginalGriff13-Dec-16 8:12
mveOriginalGriff13-Dec-16 8:12 
GeneralRe: Pascal to C# Convert Pin
PIEBALDconsult13-Dec-16 9:06
mvePIEBALDconsult13-Dec-16 9:06 
GeneralRe: Pascal to C# Convert Pin
NotPolitcallyCorrect13-Dec-16 9:26
NotPolitcallyCorrect13-Dec-16 9:26 
GeneralRe: Pascal to C# Convert Pin
Daniel Pfeffer13-Dec-16 20:24
professionalDaniel Pfeffer13-Dec-16 20:24 
GeneralRe: Pascal to C# Convert Pin
OriginalGriff13-Dec-16 21:41
mveOriginalGriff13-Dec-16 21:41 

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.