Web Config / DB string on ASP.net

ITsolutionWizard
ITsolutionWizard used Ask the Experts™
on
I have a common web config connection strings in asp.net / IIS / MS SQL Server Express DB.
When it is on localhost, everything is working. Both file web config & connectionstrings.config file are in the same directory level.

When it is on www.abc.com, the database does not read and have no error message.
Any idea how to fix it?

Web config
<connectionStrings configSource="connectionStrings.config" />

Open in new window


connectionStrings.config file name
<add 
       name="pwrsssdfsadfasdf_connectionstring"  
       connectionString="Data Source=WIN-GB8M3MMasdfasdf6T2M\SQLEXPRESS;Initial Catalog=dbdata;Integrated Security=True;User ID=sa;Password=asdfdsa000!"
       providerName="System.Data.SqlClient"
       />

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Obadiah ChristopherDeveloper User Interface

Commented:
What is this Data Source?

WIN-GB8M3MMasdfasdf6T2M\SQLEXPRESS
First of all you should not disclose any passwords here. Remove the pwd from your question and change the sa pwd on your SQL Server Express.
Second, to combine Integrated Security with User ID and pwd is not good, so remove the Integrated Security from the conn string or the User ID and pwd.
Third, allow remote connections on SQL Server Express. Look e.g. here: https://blogs.msdn.microsoft.com/sqlexpress/2005/05/05/how-to-configure-express-to-accept-remote-connections/ how to do it
Fourth, use user with lower rights than sa. It is better to disable sa user on the server exposed to external world and use a different user for SQL administration.

Test the connection from the server where IIS is running or update your application to do the test and return the result on some web page which you may then remove.
Check first pcelba suggestion. After that ask yourself this question

- Did you are hosting the www.abc.com website in your machine or pointing to your machine??? ??
 
If your answer is yes then check the connection to your database (firewall open ports that allow connect throught sql ports) , if your answer is no and you're connected to a database that reside on www.abc.com host machine then you need to point your connection string to that database like www.abc.com\SQLEXPRESS. if is an sql express what you are using on that domain.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial