English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a table Client Information whose primary key is "ClientAccountNumber" which is used as foriegn key in another table named Liquidation.

I want to update ClientInformation's Address but the error says that this table is related to the other table Liquidation so you cannot update or delete.

I want to explain that I am updating only address which is not used in the other table. It should be updated.

Plz help me

2007-06-19 11:36:40 · 2 answers · asked by raja 1 in Computers & Internet Programming & Design

2 answers

The update function you are using in the Table Adapter may not be using an update SQL statement but rather first a delete followed by an insert. The result is the same in that the record information is changed but this violates relational integrity and bombs out... A true sql UPDATE command should work and changes the data in an existing record.


Try writing a SQL UPDATE query and use it as a stored proceedure OR manually configure a table adapter with an update SQL statement

2007-06-19 13:21:24 · answer #1 · answered by MarkG 7 · 0 0

the only element incorrect is which you have secure ClientAccountNumber interior the SET clause, and because it somewhat is a factor of the foreign places key constraint, it reasons the blunders. you purely elect that interior the the place clause. purely do away with that element of the SET clause and that's going to artwork. it somewhat is the edited fact: "replace Client_Information set ClientName = '" & ClientName.text cloth & "', handle = '" & handle.text cloth & "', PhoneNumber = '" & PhoneNumber.text cloth & "', CellNumber = '" & CellNumber.text cloth & "', NIC = '" & NIC.text cloth & "', DateofOpenning = '" & DateofOpenning.text cloth & "' the place " & " ClientAccountNumber = " & ClientAccountNumber.text cloth & ";"

2016-12-08 13:50:30 · answer #2 · answered by vallee 4 · 0 0

fedest.com, questions and answers