Hi all,
I'm sorry if my question isn't clear.
I have a class contain some properties and one of them is "Parent" which the same type of this class.
when i read data from Database i set the suitable value for each property. But how could i put the "Parent" property when i read it from database as "ParentID".
If it's not clear I'll put Example.
thank you very much in advanced.
This's my class:
class smsPart
{
private int _id;
private smsPart _parent;
private string _name;
public int ID
{
get { return _id; }
set { _id = value; }
}
public smsPart Parent
{
get { return _parent; }
set { _parent = value; }
}
public string Name
{
get { return _name; }
set { _name = value; }
}
public smsPart()
{
this._id = 0;
this._parent = null;
this._name = null;
}
public smsPart(int pID, smsPart pParent, string pName, smsType pType)
{
this._id = pID;
this._parent = pParent;
this._name = pName;
}
}
and when i read data from database i fill "ID" as int and "Name" as string.
but how i would set "Parent" as "smsPart" when i read it from database as "ParentID" int.??