T
tedqn
I keep getting the error of not shared member or something. Basically
within a class, I have a constructor that takes in an sql connection
string and init a connection object to be accessible by all members
instead of init several connections locally for each member function .
Help!
public class CommonUtilObj
{ public SqlConnection g_objConnection; //global connection variable
// constructor takes in a connection string and open the sql
connection to be used by methods
public CommonUtilObj(String connStr)
{
g_objConnection = new SqlConnection(connStr);
g_objConnection.Open();
}
public void DeleteAd(int adID)
{
SqlCommand objCommand = g_objConnection.CreateCommand();
within a class, I have a constructor that takes in an sql connection
string and init a connection object to be accessible by all members
instead of init several connections locally for each member function .
Help!
public class CommonUtilObj
{ public SqlConnection g_objConnection; //global connection variable
// constructor takes in a connection string and open the sql
connection to be used by methods
public CommonUtilObj(String connStr)
{
g_objConnection = new SqlConnection(connStr);
g_objConnection.Open();
}
public void DeleteAd(int adID)
{
SqlCommand objCommand = g_objConnection.CreateCommand();