Click here to Skip to main content
15,884,298 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to merge cells in Excel using C# Pin
Ismael Oliveira 202114-Aug-21 12:46
Ismael Oliveira 202114-Aug-21 12:46 
GeneralRe: How to merge cells in Excel using C# Pin
Richard MacCutchan14-Aug-21 21:09
mveRichard MacCutchan14-Aug-21 21:09 
QuestionPassing a variable from an string to a For loop Pin
Alex Dunlop11-Aug-21 23:55
Alex Dunlop11-Aug-21 23:55 
AnswerRe: Passing a variable from an string to a For loop Pin
Pete O'Hanlon12-Aug-21 2:28
mvePete O'Hanlon12-Aug-21 2:28 
GeneralRe: Passing a variable from an string to a For loop Pin
harold aptroot12-Aug-21 2:42
harold aptroot12-Aug-21 2:42 
AnswerRe: Passing a variable from an string to a For loop Pin
Richard Deeming12-Aug-21 2:48
mveRichard Deeming12-Aug-21 2:48 
AnswerRe: Passing a variable from an string to a For loop Pin
jsc4212-Aug-21 3:08
professionaljsc4212-Aug-21 3:08 
AnswerRe: Passing a variable from an string to a For loop Pin
Dave Kreskowiak12-Aug-21 3:32
mveDave Kreskowiak12-Aug-21 3:32 
No, that's not how compiled code works. You cannot reference a variable just by creating a string of the variable name.

Well, that's not entirely true, but it is in the sense you're trying to do it. To do it your way, you have to jump through a few flaming hoops and use a bit of parsing and Reflection to get it done. That's WAY more work on your part and makes for some very slow code.

In a word: DON'T.

AnswerRe: Passing a variable from an string to a For loop Pin
Gerry Schmitz12-Aug-21 4:13
mveGerry Schmitz12-Aug-21 4:13 
AnswerRe: Passing a variable from an string to a For loop Pin
OriginalGriff12-Aug-21 4:20
mveOriginalGriff12-Aug-21 4:20 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop12-Aug-21 6:16
Alex Dunlop12-Aug-21 6:16 
GeneralRe: Passing a variable from an string to a For loop Pin
OriginalGriff12-Aug-21 6:36
mveOriginalGriff12-Aug-21 6:36 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop12-Aug-21 8:55
Alex Dunlop12-Aug-21 8:55 
GeneralRe: Passing a variable from an string to a For loop Pin
OriginalGriff12-Aug-21 22:49
mveOriginalGriff12-Aug-21 22:49 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop13-Aug-21 7:26
Alex Dunlop13-Aug-21 7:26 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop13-Aug-21 7:31
Alex Dunlop13-Aug-21 7:31 
GeneralRe: Passing a variable from an string to a For loop Pin
OriginalGriff14-Aug-21 1:35
mveOriginalGriff14-Aug-21 1:35 
GeneralRe: Passing a variable from an string to a For loop Pin
Alex Dunlop13-Aug-21 7:39
Alex Dunlop13-Aug-21 7:39 
QuestionHow to split an string and remove extra spaces Pin
Alex Dunlop10-Aug-21 22:55
Alex Dunlop10-Aug-21 22:55 
AnswerRe: How to split an string and remove extra spaces Pin
Richard MacCutchan10-Aug-21 23:39
mveRichard MacCutchan10-Aug-21 23:39 
AnswerRe: How to split an string and remove extra spaces Pin
Pete O'Hanlon11-Aug-21 7:33
mvePete O'Hanlon11-Aug-21 7:33 
GeneralRe: How to split an string and remove extra spaces Pin
OriginalGriff11-Aug-21 7:58
mveOriginalGriff11-Aug-21 7:58 
QuestionLinq To SQL Join Question Pin
Kevin Marois9-Aug-21 6:35
professionalKevin Marois9-Aug-21 6:35 
AnswerRe: Linq To SQL Join Question Pin
Richard Deeming9-Aug-21 21:03
mveRichard Deeming9-Aug-21 21:03 
GeneralRe: Linq To SQL Join Question Pin
Nathan Minier10-Aug-21 5:46
professionalNathan Minier10-Aug-21 5:46 

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.