Click here to Skip to main content
15,902,777 members
Home / Discussions / C#
   

C#

 
GeneralRe: i got some xml questions Pin
Miroslav885-May-09 9:43
Miroslav885-May-09 9:43 
GeneralRe: i got some xml questions Pin
harold aptroot5-May-09 10:57
harold aptroot5-May-09 10:57 
AnswerRe: i got some xml questions Pin
led mike5-May-09 4:31
led mike5-May-09 4:31 
QuestionConvert Variant in VB to C# Pin
klaydze5-May-09 3:22
klaydze5-May-09 3:22 
AnswerRe: Convert Variant in VB to C# Pin
Le centriste5-May-09 5:19
Le centriste5-May-09 5:19 
GeneralRe: Convert Variant in VB to C# Pin
klaydze6-May-09 2:20
klaydze6-May-09 2:20 
QuestionVariant in VB to C# Pin
klaydze5-May-09 3:13
klaydze5-May-09 3:13 
AnswerRe: Variant in VB to C# Pin
Simon P Stevens5-May-09 4:39
Simon P Stevens5-May-09 4:39 
A variant in VB is something that can be any type. The closest equivalent in C# is an 'Object'. In C# all data types derive from Object, so you can return the value as an Object and then cast it to what ever type it actually is.

(By the way, this is rather bad programming style, you should really be using parametrized queries, or stored procedures. This code is very vulnerable to SQL injection attacks. Also, by just chucking objects around everywhere you lose a lot of the benefits of strongly typed languages like C# such as compile time type checking. Also you seem to be repeating your select/case block about 3 times with the same code in it each time, it seems like you might have some redundant code here)

Simon

GeneralRe: Variant in VB to C# Pin
klaydze6-May-09 2:17
klaydze6-May-09 2:17 
GeneralRe: Variant in VB to C# Pin
Simon P Stevens6-May-09 2:57
Simon P Stevens6-May-09 2:57 
GeneralRe: Variant in VB to C# Pin
klaydze6-May-09 3:51
klaydze6-May-09 3:51 
GeneralRe: Variant in VB to C# Pin
Simon P Stevens6-May-09 4:38
Simon P Stevens6-May-09 4:38 
GeneralRe: Variant in VB to C# Pin
klaydze6-May-09 4:58
klaydze6-May-09 4:58 
GeneralRe: Variant in VB to C# Pin
Simon P Stevens6-May-09 6:14
Simon P Stevens6-May-09 6:14 
GeneralRe: Variant in VB to C# Pin
klaydze7-May-09 3:44
klaydze7-May-09 3:44 
QuestionRich Text Box Flicker Pin
Paul Unsworth5-May-09 3:12
Paul Unsworth5-May-09 3:12 
AnswerRe: Rich Text Box Flicker Pin
Nuri Ismail5-May-09 5:45
Nuri Ismail5-May-09 5:45 
GeneralRe: Rich Text Box Flicker Pin
Paul Unsworth5-May-09 21:15
Paul Unsworth5-May-09 21:15 
QuestionCalling C# function in Java Pin
raesa5-May-09 1:40
raesa5-May-09 1:40 
AnswerRe: Calling C# function in Java Pin
Nagy Vilmos5-May-09 1:54
professionalNagy Vilmos5-May-09 1:54 
GeneralRe: Calling C# function in Java Pin
raesa5-May-09 2:02
raesa5-May-09 2:02 
GeneralRe: Calling C# function in Java Pin
Tom Deketelaere5-May-09 2:25
professionalTom Deketelaere5-May-09 2:25 
GeneralRe: Calling C# function in Java Pin
Nagy Vilmos5-May-09 2:29
professionalNagy Vilmos5-May-09 2:29 
QuestionProcess's changes Pin
lost_in_code5-May-09 1:09
lost_in_code5-May-09 1:09 
Questionc# socket server error Pin
Whydah5-May-09 0:49
Whydah5-May-09 0:49 

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.