I have a desktop and web application connected to same database. Which is the most preferred method to make them communicate with each other?
You should use SOA
and then both your desktop app and web app should communicate with the Service.
And the Service
will be responsible for communicating with the database.