Hello! I have a database with two tables, ProductLine and Supplier. ProductLine contains the foreign key SupplierId, while Supplier has a field "Name".
Table ProductLine: ProductLineId(PK), Name, SupplierId(FK) etc.
Table Supplier: SupplierId(PK), Name etc.
In my program I have two classes, ProductLine and Supplier, of which ProductLine has the member "Supplier SupplierId". This member is mapped the following way in ProductLine.hbm.xml (my NHibernate-mapping for ProductLine):
<many-to-one name="SupplierId" class="Supplier"/>
In my Web-site, I want a gridview to display the names of all productlines and the associated suppliers. For this reason, I built a method GetAllProductLines() and bound it to the gridview. Furtherly, I attached the following datafields to the gridview:
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="SupplierId" HeaderText="Supplier" />
The gridview displays:
Name: xy (correct)
Supplier: [Namespace].Supplier
What´s wrong? How can I get the name of the suppliers? Please ask for more detailed information if this is not enough.
MG, J. Carl