Answer the question
In order to leave comments, you need to log in
Datagridview - how to load values into DataGridViewComboBoxColumn from DB via Nhibernate?
Greetings.
Do not tell me how to load values from the database into the Datagridview, into the DataGridViewComboBoxColumn via Nhibernate?
Initial conditions. There are two tables Recipes and Products.
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Dietolog.Domain.Products, Dietolog" table="Products" lazy="true">
<id name="Id" column="Id">
<generator class="native">
<param name="sequence">PRODUCTS_ID_GEN</param>
</generator>
</id>
<property name="Name" column="Name" type="String"/>
<property name="Cost" column="Cost" type="Double"/>
<property name="IsPerishable" column="Is_Perishable" type="Boolean"/>
</class>
</hibernate-mapping>
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Dietolog.Domain.Recipes , Dietolog" table="Recipes " lazy="true">
<id name="Id" column="Id">
<generator class="native">
<param name="sequence">RECIPES_ID_GEN</param>
</generator>
</id>
<many-to-one name="Product" column="Product_ID" not-null="true" class="Dietolog.Domain.Products, Dietolog"/>
<property name="Weight" column="Weight" type="Double"/>
</class>
</hibernate-mapping>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question