both or either in negative sentences? [closed]

"I was invited to two parties, but I couldn't go to both of them." - this suggests that you were able to go to one of them, but not both - perhaps they were on at the same time, for example.

"I was invited to two parties, but I couldn't go to either of them." - this states that you could go to none of the parties.

So, you can see that the meaning is quite different. Both are grammatically correct, so either could be correct depending on the context.