I'm finding that .AutoIncrementCustom doesn't take affect until after the physical table is "touched". Specifically, if I call myBusinessObject.NewRow() before any actual data access occurs, MM can't tell that there's an autoincrement column. More specifically, this if statement returns false:
if (ds.Tables[tableName].ExtendedProperties.Contains(AUTOINCREMENTCOLUMN))
{
AIColumn = ds.Tables[tableName].ExtendedProperties[AUTOINCREMENTCOLUMN].ToString();
ds.Tables[tableName].Columns[AIColumn].AutoIncrement = false;
}
So even though I specify .AutoIncrementCustom = true in the business object, my new row's PK value is 0, instead of -1.
Should I just select a bogus record from the table to get this working? Seems easy but wrong (my table may also be empty of records). Any way to force this?
Thanks,
Mike