Architecture
.NET Development
Windows Vista
VS Express Editions
Visual J#
Windows Forms
Visual FoxPro
VS Team System
SQL Server
Game Technologies
Visual C#
Smart Device
Visual C++
Microsoft ISV
Visual Basic
Software Development Network>> Visual C#>> Global variable
Global variable
Hot Topic
How does Properties window in VS.NET 2003 work?
MSDN Library for VS.NET 2003 download
Call .bat files
Deep equivalence testing?
Launching custom forms from Property Grid!
Excel Interop
Problem with timer and progress bar
How to deploy a dotnet win application WITHOUT DotNetFramework 2.0
Create my own quota management solution for windows 2000
Run an .exe from the build events
Visual C#
Replace main node name
WMI/Win32
Ressources from another assembly
Polymorphic Collections
Aborting and Managing Threads: The Dog or the Cat?
Potential Bug with C#
optgroup
How can I make a treeview node selected?
how to link c# without IDE
bytes in a byte[]
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
lguger
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
lguger
Here is a simple way to do a global variable.
class Global
{
public static string PublicVariable;
}
// ...
Global.PublicVariable = "aaa";