Example of the error given with Assassin's Creed III, the exe name given may differ.
Method 1 - Install Direct X from the Disc
To install Direct X from your retail disc, insert your disc and then explore the contents. This may differ from game to game, but generally you will find your Direct X installer under Setup\DirectX as below:
Run the DXSETUP.exe and follow the installation wizard to update your Direct X files.
Method 2 - Install Direct X from the web
As an alternative to installing Direct X from the game DVD, you can also update Direct X directly from the Internet. To do this browse to the Microsoft website.
Download the small web-installer and launch the file. Now follow the install wizard to complete the installation.
Once complete this will should resolve the issue and allow you to play your game.