DeleteCommand in SqlDataSource using DetailsView
Hi guys,
Figure that:
- I have two related tables by IDName:
1 - table Name (fields: IDName, Name)
2 - table Products (fields: IDProduct, IDName, Product)
On the page I have a DetailsView for inserting data on table Name and a GridView for editing and deleting records. In table Name, deleting and editing are ok but if I have a reference of IDName in table Product the deleting send me an error
---------------------------------------------
The DELETE statement conflicted with the REFERENCE constraint "FK_Produto_Fab ricante". The conflict occurred in database "JanainaPapelar ia", table "dbo.Produt o", column 'fabCodigo'.
The statement has been terminated.
---------------------------------------------
Does anyone know how to treat this so when a record in table Name has a reference record in table Products the DeleteCommand of the SqlDataSource doesn´t trigger?
thanks a lot
Hi guys,
Figure that:
- I have two related tables by IDName:
1 - table Name (fields: IDName, Name)
2 - table Products (fields: IDProduct, IDName, Product)
On the page I have a DetailsView for inserting data on table Name and a GridView for editing and deleting records. In table Name, deleting and editing are ok but if I have a reference of IDName in table Product the deleting send me an error
---------------------------------------------
The DELETE statement conflicted with the REFERENCE constraint "FK_Produto_Fab ricante". The conflict occurred in database "JanainaPapelar ia", table "dbo.Produt o", column 'fabCodigo'.
The statement has been terminated.
---------------------------------------------
Does anyone know how to treat this so when a record in table Name has a reference record in table Products the DeleteCommand of the SqlDataSource doesn´t trigger?
thanks a lot
Comment