Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
QuestionLinq with Link List Pin
Khaniya1-Feb-10 19:15
professionalKhaniya1-Feb-10 19:15 
AnswerRe: Linq with Link List Pin
Calla1-Feb-10 21:32
Calla1-Feb-10 21:32 
GeneralRe: Linq with Link List Pin
Khaniya1-Feb-10 22:19
professionalKhaniya1-Feb-10 22:19 
GeneralRe: Linq with Link List Pin
Anurag Gandhi2-Feb-10 0:04
professionalAnurag Gandhi2-Feb-10 0:04 
GeneralRe: Linq with Link List Pin
Khaniya2-Feb-10 17:45
professionalKhaniya2-Feb-10 17:45 
Questionis Global variable good or bad in c#.net? Pin
vnsraj1-Feb-10 18:46
vnsraj1-Feb-10 18:46 
AnswerRe: is Global variable good or bad in c#.net? Pin
Eric (eD)1-Feb-10 19:30
Eric (eD)1-Feb-10 19:30 
GeneralRe: is Global variable good or bad in c#.net? Pin
#realJSOP1-Feb-10 23:37
mve#realJSOP1-Feb-10 23:37 
Eric (eD) wrote:
As a general practice, global variables are bad.


Myth. Global variables should generally be avoided when possible (and used as a last resort), but they're not "bad", and there are times when you simply must use one to accomplish some tasks. Besides that, global variables *technically* aren't even possible in .Net.


Eric (eD) wrote:
You may want to use a static global variable for things like links or connection information etc. This means that the variable cannot be changed at any point of from anywhere else in the program though.


Not quite. Static members in an object exist for the lifetime of the application, and can be changed from anywhere (and by any other object) if they have the appropriate visibility. In fact, it's common practice to create a static class for just that purpose. In many ways, using static class members can be fraught with as much - if not more than - "global" variables, but like globals, they're pretty damn handy in a pinch, and you shouldn't hesitate to use them if the architecture demands it.

.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

AnswerRe: is Global variable good or bad in c#.net? Pin
dojohansen1-Feb-10 23:29
dojohansen1-Feb-10 23:29 
QuestionHow to swap bounded columns to rows in datagridview Pin
VenkataRamana.Gali1-Feb-10 18:43
VenkataRamana.Gali1-Feb-10 18:43 
AnswerRe: How to swap bounded columns to rows in datagridview Pin
Anurag Gandhi1-Feb-10 20:07
professionalAnurag Gandhi1-Feb-10 20:07 
Questiondownloading file. in response: "Content-Disposition: attachment; filename="file.gif"" Pin
hello_amigo1-Feb-10 15:46
hello_amigo1-Feb-10 15:46 
AnswerRe: downloading file. in response: "Content-Disposition: attachment; filename="file.gif"" Pin
Not Active1-Feb-10 16:17
mentorNot Active1-Feb-10 16:17 
QuestionDynamic Multiple Dropdown Lists using Access Database Pin
scorpio221-Feb-10 13:44
scorpio221-Feb-10 13:44 
AnswerCross post Pin
Not Active1-Feb-10 16:14
mentorNot Active1-Feb-10 16:14 
GeneralRe: Cross post Pin
scorpio222-Feb-10 1:33
scorpio222-Feb-10 1:33 
GeneralRe: Cross post Pin
Not Active2-Feb-10 1:56
mentorNot Active2-Feb-10 1:56 
GeneralRe: Cross post Pin
scorpio222-Feb-10 2:55
scorpio222-Feb-10 2:55 
QuestionOpen Source Project Pin
programmervb.netc++1-Feb-10 13:06
programmervb.netc++1-Feb-10 13:06 
AnswerRe: Open Source Project Pin
April Fans2-Feb-10 20:18
April Fans2-Feb-10 20:18 
GeneralRe: Open Source Project Pin
programmervb.netc++3-Feb-10 16:17
programmervb.netc++3-Feb-10 16:17 
QuestionSending AT commands to a v.92 USB modem Pin
saeidfarahi1-Feb-10 11:55
saeidfarahi1-Feb-10 11:55 
AnswerRe: Sending AT commands to a v.92 USB modem Pin
Luc Pattyn1-Feb-10 12:10
sitebuilderLuc Pattyn1-Feb-10 12:10 
AnswerRe: Sending AT commands to a v.92 USB modem Pin
PIEBALDconsult1-Feb-10 15:01
mvePIEBALDconsult1-Feb-10 15:01 
GeneralRe: Sending AT commands to a v.92 USB modem Pin
Luc Pattyn1-Feb-10 15:11
sitebuilderLuc Pattyn1-Feb-10 15:11 

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.