I was trying to host a small DNN application in one of our Server and I was facing couple of issues.
Problem 1:
The first problem I faced is it was always redirecting to localhost, whenever I tried http://domain.com/dnn it was redirecting to http://localhost/dnn as a result the site was un-accessible from outside.
Solution
Two common errors done while writing the SqlDataProvider SQL are
1. Not saving the file that contains SqlDataProvider SQL codes in the correct format. A quick trick is to open the files in NotePad and save them as "Unicode".
2. Not putting atleast 2 line breaks after each GO statement in the SQLDataProvider SQL code.
Hope this helps.