Hi,
I'm a newbie about O/R mapping structures, but this is the situation.
I have two tables with a m:1 relation. I have defined this by the designer:
table1: ID (PK), table2ID, textcolumn
table2: ID (PK), textcolumn
So, the relation is: table1.table2ID -> table2.ID
I created a UserControl which will used for databinding. Internally in this UserControl I create a kind of combobox with all rows of table2.
Databinding will be done by property ID of this UC from the main program.
Oke, back to the UserControl. All rows will be loaded by datasource Table2EntityCollection. I use GetMulti() to load.
With this usercontrol, user enter some text. During typing, a row match what user types will show. But, sometime will the user enter a new value.
Then, I add a new entity to the collection (method Add(NewEntity)). But after that, the Id of this new entity is zero and not a new value of autoincrement.
Also, I can use the Save() method of the entity, but the value will me add to the database immediatly what I don't.
So, why can I not get the ID when add the entity to collection?
(And maybe, is this the correct way about logical ways)