T
Tom
Well, another day, another problem it seems. I would REALLY appreciate some
help here. I've looked all over already and come up empty handed. so here
we go:
I have a database program that accesses an Access 2000 DB (unfortunately).
Im using 2 views that are derived from 3 tables (tblGroup, tblEmployee,
tblEmployeeGroup)
tblGroup(*groupID, groupName, etc)
groupid->autonumber
groupName->string
tblEmployee(*employeeID,name, etc)
employeeID->autonumber
name->string
tblEmployeeGroup(*employeeID,*groupID)
employeeID->foreign key
groupID->foreign key
i have 2 comboxes on a windows form (cmbGroup and cmbEmployee).
-cmbGroup displays all the groups
-cmbGroup is filled with a view of all the groups and the
selectedvalue is bound to groupID
-cmbEmployee displays only the employees in the group that cmbGroup is
displaying
-cmbEmployee is filled with stored procedure(view) that gets a
parameter(groupID) that i set to cmbGroup.selectedvalue
All my tables/views are stored in the same dataset.
so, everytime cmbGroup's selectedvalue is changed, the cmbGroup
selectedvalueChanged is called and i clear the tblEmployee table in the
dataset, then refill with the proper parameter. all is well.
But, as soon as I select an employee in cmbEmployee, then select a different
group from cmbGroup, cmbGroup becomes "sticky". As soon as you select a
different group, then click on the actual windows form (to give it focus),
it goes back to the previous group selected. So, cmbGroup.selectedvalue
doesn't change to the newly selected value! therefore, cmbEmployee will
also not update to the relevant employees in the group that was actually
selected. Then the program crashes with this error:
"An unhandled exception of type 'System.Data.ConstraintException' occurred
in system.data.dll
Additional information: Column 'groupID' is constrained to be unique. Value
'4' is already present."
Now, i understand the error, but how to fix it? Is it a dataset property i
have to set? I've looked at LOTS of other news groups through google/groups
and so far have come up with nothing like this. If someone could please
help me with this, that would be great. thx
tom
help here. I've looked all over already and come up empty handed. so here
we go:
I have a database program that accesses an Access 2000 DB (unfortunately).
Im using 2 views that are derived from 3 tables (tblGroup, tblEmployee,
tblEmployeeGroup)
tblGroup(*groupID, groupName, etc)
groupid->autonumber
groupName->string
tblEmployee(*employeeID,name, etc)
employeeID->autonumber
name->string
tblEmployeeGroup(*employeeID,*groupID)
employeeID->foreign key
groupID->foreign key
i have 2 comboxes on a windows form (cmbGroup and cmbEmployee).
-cmbGroup displays all the groups
-cmbGroup is filled with a view of all the groups and the
selectedvalue is bound to groupID
-cmbEmployee displays only the employees in the group that cmbGroup is
displaying
-cmbEmployee is filled with stored procedure(view) that gets a
parameter(groupID) that i set to cmbGroup.selectedvalue
All my tables/views are stored in the same dataset.
so, everytime cmbGroup's selectedvalue is changed, the cmbGroup
selectedvalueChanged is called and i clear the tblEmployee table in the
dataset, then refill with the proper parameter. all is well.
But, as soon as I select an employee in cmbEmployee, then select a different
group from cmbGroup, cmbGroup becomes "sticky". As soon as you select a
different group, then click on the actual windows form (to give it focus),
it goes back to the previous group selected. So, cmbGroup.selectedvalue
doesn't change to the newly selected value! therefore, cmbEmployee will
also not update to the relevant employees in the group that was actually
selected. Then the program crashes with this error:
"An unhandled exception of type 'System.Data.ConstraintException' occurred
in system.data.dll
Additional information: Column 'groupID' is constrained to be unique. Value
'4' is already present."
Now, i understand the error, but how to fix it? Is it a dataset property i
have to set? I've looked at LOTS of other news groups through google/groups
and so far have come up with nothing like this. If someone could please
help me with this, that would be great. thx
tom