T
tshad
I am getting a message for my objects that say:
testNulls.cs(13,33): error CS0122: 'FtsData.IntType.IntType()' is
inaccessible due to its protection level
I have a class calling objects out of another class, but same namespace.
This is the class that gets the error:
**************************************************************
namespace FtsData
{
[Serializable]
public class TestNulls
{
private IntType testNullsID = new IntType(); <---------
Error line
private StringType firstName = new StringType();
private DecimalType salary = new DecimalType();
public TestNulls()
{
salary.Data = 12345;
}
....
************************************************************
The class that defines the IntType objects:
*************************************************
using System;
namespace FtsData
{
[Serializable]
public class IntType
{
private int first = 0; //original data
private int data = 0; //current data
private bool nullFirst = false; //original Data null
private bool nullData = false; //current data null
private IntType()
{
}
private IntType(int initial)
{
first = initial;
data = initial;
}
public bool IsNull()
{
return nullData;
}
public bool IsFirstNull()
{
return nullFirst;
}
public void SetNull()
{
nullData = true;
data = 0;
}
public void SetFirstNull()
{
nullFirst = true;
first = 0;
}
// Properties
public int First
{
get { return first; }
set { first = value; }
}
public int Data
{
get { return data; }
set { data = value; nullData = false; }
}
} // end Class
****************************************************
There are a bunch of classes - one for each datatype.
But I am getting an error trying to instantiate the object, but not sure
why?
Thanks,
Tom
testNulls.cs(13,33): error CS0122: 'FtsData.IntType.IntType()' is
inaccessible due to its protection level
I have a class calling objects out of another class, but same namespace.
This is the class that gets the error:
**************************************************************
namespace FtsData
{
[Serializable]
public class TestNulls
{
private IntType testNullsID = new IntType(); <---------
Error line
private StringType firstName = new StringType();
private DecimalType salary = new DecimalType();
public TestNulls()
{
salary.Data = 12345;
}
....
************************************************************
The class that defines the IntType objects:
*************************************************
using System;
namespace FtsData
{
[Serializable]
public class IntType
{
private int first = 0; //original data
private int data = 0; //current data
private bool nullFirst = false; //original Data null
private bool nullData = false; //current data null
private IntType()
{
}
private IntType(int initial)
{
first = initial;
data = initial;
}
public bool IsNull()
{
return nullData;
}
public bool IsFirstNull()
{
return nullFirst;
}
public void SetNull()
{
nullData = true;
data = 0;
}
public void SetFirstNull()
{
nullFirst = true;
first = 0;
}
// Properties
public int First
{
get { return first; }
set { first = value; }
}
public int Data
{
get { return data; }
set { data = value; nullData = false; }
}
} // end Class
****************************************************
There are a bunch of classes - one for each datatype.
But I am getting an error trying to instantiate the object, but not sure
why?
Thanks,
Tom