After trying all of the mentioned solution and still having no luck I found a solution.
The solution for me to this issue was to uninstall sql server 2005. after a bit of research I found that it is not compatible with win8.1 so I removed it and tried again. This time it worked.