I
Islam Elkhayat
I hve Dataclasses one for each dbtable & i have user control with MoveNext()
& MovePrev() methods
i want the toolbar to use the current class so i created an Interface
(IDbClasses) with the 2 methods and i use it in the user control,
i also added a poperty of type IDbClasses to pass instance of the current
class like this:
UserControl....
IDataClasses dclass;
<<<<<<<dclass = CurrentObj>>>>>>>>>>>>>;
private IDataClasses currobj;
public IDataClasses CurrentObj
{
get{return currobj; }
set{currobj = value; }
}
in the main form>>
IDataClasses dclass;
UserControl myctrl;
dclass = new Employees();
in the page load...
myctrl = new UserControl();
myctrl.CurrentObj = dclass;
when i click the buttons in the user contrl i get an "object not set an
instance" Exception from the line:
dclass = CurrentObj in the user control how could i fix the error??
& MovePrev() methods
i want the toolbar to use the current class so i created an Interface
(IDbClasses) with the 2 methods and i use it in the user control,
i also added a poperty of type IDbClasses to pass instance of the current
class like this:
UserControl....
IDataClasses dclass;
<<<<<<<dclass = CurrentObj>>>>>>>>>>>>>;
private IDataClasses currobj;
public IDataClasses CurrentObj
{
get{return currobj; }
set{currobj = value; }
}
in the main form>>
IDataClasses dclass;
UserControl myctrl;
dclass = new Employees();
in the page load...
myctrl = new UserControl();
myctrl.CurrentObj = dclass;
when i click the buttons in the user contrl i get an "object not set an
instance" Exception from the line:
dclass = CurrentObj in the user control how could i fix the error??