E
Eric Sabine
Here should be an easy question. I want to overload the ctor of the class
with 2 versions, one takes 3 input parameters and the other takes 2, if I
call the "2" version I want to simply call the 3 version but pass in a
private variable for the missing parameter. But at compile time, I get
"An object reference is required for the nonstatic field, method, or
property ..."
public class TestExample
{
private string m_tablename;
// public properties
public string TableNameToCreate
{ set { m_tablename=value; } }
// the ctors
public xsd_retrieving(string ConnectionString, string SqlStatement):
this(ConnectionString, SqlStatement, m_tablename)
{
// There is to be no code here
}
public TestExample(string ConnectionString, string SqlStatement,
string TableName
{
......
}
} // TestExample
with 2 versions, one takes 3 input parameters and the other takes 2, if I
call the "2" version I want to simply call the 3 version but pass in a
private variable for the missing parameter. But at compile time, I get
"An object reference is required for the nonstatic field, method, or
property ..."
public class TestExample
{
private string m_tablename;
// public properties
public string TableNameToCreate
{ set { m_tablename=value; } }
// the ctors
public xsd_retrieving(string ConnectionString, string SqlStatement):
this(ConnectionString, SqlStatement, m_tablename)
{
// There is to be no code here
}
public TestExample(string ConnectionString, string SqlStatement,
string TableName
{
......
}
} // TestExample