0

My Phases table in Lightswitch used to be related to 2 of my tables. I deleted the association but there is one record that can not be deleted for some reason, It says they are related records referncing it

Thuto Paul Gaotingwe
  • 1,425
  • 4
  • 15
  • 15

3 Answers3

0

It sounds to me like you've only deleted one of the two associations (one for each related table - you mentioned that the Phases table was related to two tables).

Also, in the table designer, you can right-click the line that joins two tables (representing the realtionship between them), select Edit Relationship, & change the default On Delete Behavior from Restricted to Cascade Delete.

The default Restricted will do exactly what it says, it will restrict you from deleting records that have related records. Cascade Delete will allow you to delete a record that has related & will also delete the related records as well.

I hope that helps.

Yann Duran
  • 3,842
  • 1
  • 24
  • 24
  • Was not relationship problem (well to some extend), just a single record was refusing to be deleted.. i think it had to do with default databinding performed by lightswitch but I renamed my table and I was able to delete the record. Thanks Yann! – Thuto Paul Gaotingwe May 16 '12 at 12:57
  • I'm glad that you got it sorted. – Yann Duran May 17 '12 at 01:07
0

Did you delete the association in the Database or in LightSwitch?

If you deleted the association in LightSwitch then the database still wont allow it.

If you deleted the association in the database did you refresh the bindings in LightSwitch?

Ralf de Kleine
  • 11,464
  • 5
  • 45
  • 87
0

Thanks guys for your help, I had to rename my tables because for some reason it seems Lightswitch cached the changes i did long time ago and kept them.. weird. But after I renamed my table I was then able to delete the record.

Thuto Paul Gaotingwe
  • 1,425
  • 4
  • 15
  • 15
  • As you are new to stackoverflow two tips: - If you have something to add to your question, please use the edit-function to add an "update". So everyone who stumbles over your question can see whats the current status. - If an answer helped you solve your question, accept it. A high accept-rate will increase the number of people willing to help you... – basti May 16 '12 at 12:56
  • Ok, thanx chiffre, how do you accept? do you click "yes" it was helpful or what? – Thuto Paul Gaotingwe May 16 '12 at 13:45
  • 1
    Click the hollow checkmark beside the answer you wish to accept. Image: http://i.stack.imgur.com/uqJeW.png Further reading: http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work Welcome to StackOverflow~ – Andrew Kozak May 16 '12 at 14:10