Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot Add a New Row
Message
De
14/09/2005 14:57:12
Patty Solomon
Central Susquehanna Intermediate Unit
Milton, Pennsylvanie, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Cannot Add a New Row
Versions des environnements
Environment:
C# 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01049588
Message ID:
01049588
Vues:
66
"Concurrency Violation: the UpdateCommand affected 0 records."

The table I'm working with has a column that references itself.
The table contains Staff members. Each staff member is assigned
a supervisor, which must exist in the staff table.

The staff bizobj is registered twice:

// driving table for form
this.oStaff = (STAFF_BO)this.RegisterPrimaryBizObj(new STAFF_BO());
// supervisor dropdownlist source
this.oStaffSuper = (STAFF_BO)this.RegisterBizObj(new STAFF_BO());
Datasets are created in the form's constructor:

// tablename="STAFF"
mmDataSet dsStaff = (mmDataSet)oStaff.GetRecordByPK
(this.CurrentPrimaryKey);

// for Supervisor dropdown list; tablename="Supervisors"
oStaffSuper.GetStaffIDName_WithBlank("Supervisors");

// Set current data set to get entered information into the new row.
// If this command is not executed, the entered data does not get into
// the new row.
// When this command executes, the dataset's Row.RowState changes from
// "Added" to "Modified", causing the concurrency error.
((STAFF_BO)this.GetBizObj("STAFF_BO")).SetCurrentDataSet(dsStaff);

The combobox binding properties:

BindingSource=STAFF_BO
BindingSourceDisplayMember=Supervisors.fullname
BindingSourceValueMember=Supervisors.staffPK
BindingValueSource=STAFF_BO
BindingValueSourceMember=staffFK

Any and all suggestions on how to fix this error are gladly accepted.
TIA -
Patty
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform