Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid update failure

Status
Not open for further replies.

dorianr

Programmer
Mar 26, 2001
32
0
0
US
I have a C# windows appliation with an Access database. There are 2 tables: USERS and PERMISSION_TYPES. Table definitions are:

Table Name: USERS
Fields:
First_Name
Last_Name
Address
PERMISSION_TYPE (FK to PERMISSION_TYPES)

Table Name: PERMISSION_TYPES
Fields:
PERMISSTION_TYPE (PK)
DESCRIPTION

The tables are linked vis the PERMISSION_TYPE field. I can make successful updates to the database, however, I'm trying to use a datagrid for each table so the user can Insert, Update, and Delete records in each table.

When the PERMISSION_TYPES.DESCRIPTION field is changed, an error message is returned that states:

"The record cannot be deleted or changed because table 'USERS' includes releated records"

This doesn't make any sense to me, since the DESCRIPTION field is not a Primary Key, and the updates are successful within Access. I have used the generated Update code, and I have written my own update code - I get the same error message.

Does anyone know what is wrong?

Thanks so much,
Randy
dorianr@mail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top