Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Force .AutoIncrementCustom
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Force .AutoIncrementCustom
Divers
Thread ID:
00994225
Message ID:
00994225
Vues:
52
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform