Hello
I am a really- really beginner regarding nHibernate. I have a problem, and I tried the last three days to solve it, without any result.
I have a test database with two tables: Employees:EmployeeID,EmployeeName,EmployeeAge
Children:ChildName,EmployeeID, ChildName
Now, when I load the data from Child table, instead of telling me the EmployeeID , it says n a datagridView: WindowsApplication1.Calsses.Em,ployee.
This is because, I Think, I created the structure like that in ChildrenClass:
private Employee employee;
public Employee EmployeeID
{
get { return employee; }
set { employee = value; }
}
the .hbm.xml file:
<many-to-one name="EmployeeID" class="WindowsApplication1.Classes.Employee,WindowsApplication1" column="EmployeeID"/>
and I loaded the information like this:
IList lstChildren =(IList) session.CreateCriteria(typeof(WindowsApplication1.Classes.Children)).List();
grdChildren.DataSource = lstChildren;
Please tell me what is wrong here??
|