Make sure you are using the 4.0 Framework and not the 4.0 Client framework.
When you uninstalled the beta did you clean up the folders and registry entries. See this SAP post for more info on removing the beta: http://forums.sdn.sap.com/thread.jspa?messageID=9733991#9733991
It may also be realted to this post: http://forums.sdn.sap.com/thread.jspa?threadID=1857957&tstart=0
What database driver are you using? If it's adoplus then add this to your app.config file:
and also check r u missing any dll refrence or not