Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Force .AutoIncrementCustom
Message
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Force .AutoIncrementCustom
Miscellaneous
Thread ID:
00994225
Message ID:
00994225
Views:
53
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:
// mmBusinessObject.cs line 3661
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
Next
Reply
Map
View

Click here to load this message in the networking platform