You can join and display datasets on a map using an ArcGIS endpoint if you join them in ArcMap. The process is described HERE. Once you make the connection in your MXD just publish it like you normally would and it will be your REST endpoint. This will allow a connection to two databases through an ArcGIS REST web service without you having to write a single line of code or alter the database. The data formats don't even have to match.
The solutions below could also be used, but are advised against.
Obviously we can't give you a project and say "here this works" but the resources you may find helpful are:
Create basic RESTful web service
Create a basic web service(not RESTful)
Working with ADO.NET and SQL server
Connection strings to an SQL database
The approaches are:
Get the web service to do the join of the data for you and then return the dataset to the application <-- this one has a specific purpose and is not reusable by other applications
Get a REST web service to return the two datasets (with whatever SQL filters) and then have the application do the join logic. <-- this on is reusable by other applications ( funny thing is that this is strangely similar to an ArcGIS endpoint ;) This can also do a join in ArcMap to be published See OPTION 3)
If your chosen solution proves to be troublesome then I highly recommend a database link like @conor suggests since the database does everything faster and should be where data is joined/modelled.
I have done this before for integration of non-spatial asset systems and spatial systems and I spoken to other GIS professionals who have done the same. The general approach is to do this at the database level. The last time I did it I used a view across a database link and the performance was as good as those without database links.
FYI documentation for setting up and using a database link