VS Express Editions
Visual C#
Windows Live
VS Team System
.NET Development
Microsoft ISV
Visual J#
Visual Studio
SQL Server
Visual Basic
Visual FoxPro
Smart Device
Visual C++
Architecture
Game Technologies
Software Development Network>> Visual C#>> Global variable
Global variable
Hot Topic
Multiple references
C# vs. C++
Specifying and Encoding w/ Trace and FileStream
Why this function return value error?
Where the Control definitions located?
Clickonce Error writing to Hard disk
script c# language
Deploying C# App. Using a Third-Party Installer
How do I determine which program window is active?
Printing Document
Visual C#
insert code to a Dll
How can I give percentage values to the columns of a listview?
Summary of C# Classes
note on instruction end
plugin based applications in C# projects
The c# Point structure
VS 2005 My things that I don’t like list…
Visual C# 2003 how to send variables in a class to other forms?
Active Directory Authentication when user is restricted to use only one System
DataGridView new row
Global variable
I have a windows applicaton written in c#. How can I store a connection globally so that I can open it at the beginning and keep until exit from the application
Answer this question
Global variable
Daqing
If it's a database connection, it is recommended to open and close it everytime you are doing a query (connection pooling will handle everything).
Here is a simple way to do a global variable.
class Global
{
public static string PublicVariable;
}
// ...
Global.PublicVariable = "aaa";
Global variable
Answer this question
Global variable
Daqing
Here is a simple way to do a global variable.
class Global
{
public static string PublicVariable;
}
// ...
Global.PublicVariable = "aaa";