creating a foreign key like relationship with custom post types

You can create relationships between posts / pages with the Posts 2 Posts plugin. (more info on the wiki)

You could then create a connexion between Case Studies and Clients, and associate them accordingly.

For clarity, you should ask your second question in a separate question, as it is not related to the title of this thread.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)