Hi
I am getting an error "Code generation for property 'SubCategoryId' failed.
Error was 'Property accessor 'SubCategoryId' on object 'yyy.zzz' threw the
following exception: 'Object reference not set to an instance of an
object.'' after porting my code from V1.1 to V2.0.
The class yyy is a class that has nothing in it except a contructor and is
derived from a MyGeneration generated class of a View in my SQL database.
The error pops up when I display a UserControl that has another Control that
is derived from TreeView and contains this zzz class. SubCategoryId is a
property of the View but the accessor looks like this
namespace yyy
{
class zzz
{
...
public virtual string SubCategoryId
{
get { return base.Getstring(ColumnNames.SubCategoryId); }
set { base.Setstring(ColumnNames.SubCategory, value); }
}
}
}
base.GetInt is defined as:
protected int Getint(string columnName)
{
return (int)_dataRow[columnName];
}
Clearly at design time _dataRow will be null but why would this property be
called and what code is VS2005 trying to generate that would use this
property?
Any ideas?
Thanks
Steven