Method 1.
Step 1, create a public class and a public static variable in the class. Which is tableName .
using System;
namespace global
{
public class global_class
{
public static string tableName="Demo";
public global_class()
{
//
// TODO: Add constructor logic here
//
}
}
}
In other winform/class files, call the variable like below:
global_class.tableName
You don't even need to create an instance of the "global_class" class.
Method 2,
If you are developing ASP.Net, you can put the global variables inside web.config file.
Happy programming...
Step 1, create a public class and a public static variable in the class. Which is tableName .
using System;
namespace global
{
public class global_class
{
public static string tableName="Demo";
public global_class()
{
//
// TODO: Add constructor logic here
//
}
}
}
In other winform/class files, call the variable like below:
global_class.tableName
You don't even need to create an instance of the "global_class" class.
Method 2,
If you are developing ASP.Net, you can put the global variables inside web.config file.
Happy programming...