Click here to Skip to main content
15,909,953 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help Pls - Updating Access DB from DataSet - DataAdapter.Update problem Pin
esulin7-Apr-07 22:06
esulin7-Apr-07 22:06 
AnswerRe: Help Pls - Updating Access DB from DataSet - DataAdapter.Update problem Pin
phantanagu8-Apr-07 22:25
phantanagu8-Apr-07 22:25 
QuestionGlobal variable in C# Pin
Hamed Musavi7-Apr-07 19:26
Hamed Musavi7-Apr-07 19:26 
AnswerRe: Global variable in C# Pin
Sathesh Sakthivel7-Apr-07 20:44
Sathesh Sakthivel7-Apr-07 20:44 
GeneralRe: Global variable in C# [modified] Pin
Hamed Musavi7-Apr-07 22:09
Hamed Musavi7-Apr-07 22:09 
AnswerRe: Global variable in C# Pin
Muammar©7-Apr-07 21:00
Muammar©7-Apr-07 21:00 
GeneralRe: Global variable in C# Pin
Hamed Musavi7-Apr-07 22:21
Hamed Musavi7-Apr-07 22:21 
GeneralRe: Global variable in C# Pin
Guffa8-Apr-07 7:55
Guffa8-Apr-07 7:55 
Hamed Mosavi wrote:
This is not as easy as a C++ global variable


It's a bit more verbous than using global variables, but verbosity is not bad in itself.

The advantages over global variables is that it's easy to locate the variable as the code says exactly where to look, and that there is no risk of name conflicts with other modules that also uses global variables.

Hamed Mosavi wrote:
I still need to identify owner: MyForm1.A.globalVar


Put the class outside the form (perhaps in a class file by itself), then you only have to specify the name of the class: A.globalvar.

Hamed Mosavi wrote:
A suggestion, make class A sealed.


Even better, make the class static. Then you can't put non-static members in it by mistake, and it's automatically sealed. Also it's obvious how the class is supposed to be used.

---
single minded; short sighted; long gone;

AnswerRe: Global variable in C# Pin
Mike_V7-Apr-07 23:00
Mike_V7-Apr-07 23:00 
GeneralRe: Global variable in C# Pin
Hamed Musavi8-Apr-07 5:51
Hamed Musavi8-Apr-07 5:51 
GeneralRe: Global variable in C# Pin
Not Active8-Apr-07 8:49
mentorNot Active8-Apr-07 8:49 
GeneralRe: Global variable in C# Pin
Mike_V8-Apr-07 9:05
Mike_V8-Apr-07 9:05 
AnswerRe: Global variable in C# Pin
Not Active8-Apr-07 8:55
mentorNot Active8-Apr-07 8:55 
QuestionSslStream and X509Chain Pin
atanamir7-Apr-07 14:26
atanamir7-Apr-07 14:26 
Questionvirtual makeover Pin
samreengr87-Apr-07 10:43
samreengr87-Apr-07 10:43 
QuestionNavigation Control Pin
indyfromoz7-Apr-07 10:25
indyfromoz7-Apr-07 10:25 
QuestionAdding controls dynamically Pin
kkadir7-Apr-07 9:49
kkadir7-Apr-07 9:49 
AnswerRe: Adding controls dynamically Pin
J$7-Apr-07 9:56
J$7-Apr-07 9:56 
GeneralRe: Adding controls dynamically Pin
kkadir7-Apr-07 10:05
kkadir7-Apr-07 10:05 
GeneralRe: Adding controls dynamically Pin
Luc Pattyn7-Apr-07 13:50
sitebuilderLuc Pattyn7-Apr-07 13:50 
GeneralRe: Adding controls dynamically Pin
phantanagu8-Apr-07 22:37
phantanagu8-Apr-07 22:37 
QuestionPaintdesktop Api with back buffer Pin
AndyBob7-Apr-07 9:38
AndyBob7-Apr-07 9:38 
AnswerRe: Paintdesktop Api with back buffer Pin
Hayder Marzouk7-Apr-07 14:44
Hayder Marzouk7-Apr-07 14:44 
GeneralRe: Paintdesktop Api with back buffer Pin
AndyBob8-Apr-07 8:58
AndyBob8-Apr-07 8:58 
QuestionWho knows how to change font in console? Pin
Zhendalf7-Apr-07 9:01
Zhendalf7-Apr-07 9:01 

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.