Connect database not working

I’m working on .NET Core Web API. I started working on local database and I can confirm that it is perfectly working fine on localhost.

Then I changed to database connection string to point in Asphostportal server. I am able to connect to the database in Asphostportal server via SSMS.

But I am not able to connect through a Web API.

Have I missed anything? Please advise.