Is there a way to build web application with R connected to visual studio and sql server?
I think you can use visual studio as your IDE if you want. There is an extension of VS for that as well that ease the experience.
You can use shiny as your web framework without a doubt.
For database connection, see db.rstudio.com you will find all the info on how to connect to a database.
For a web application with shiny the ˋpool` is recommended
Is this the kind of info you are looking for?