0
votes

I am getting a problem when I try to connect from my website to my database on my webserver (smarterasp.net). Everything works fine on the local host, then I uploaded the site to smarterasp.net and created the database there, now the site can't connect to the database, here is what I have in my web.config:

<?xml version="1.0"?>
<configuration>

<connectionStrings>
    <add name="UsersConnectionString1" connectionString="Data Source=MYSQL5012.Smarterasp.net;Initial Catalog=db_9df63f_active;Uid=9df63f_active;Pwd=MYPASSWORD; "
    providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
  <compilation targetFramework="4.5" />
  <httpRuntime targetFramework="4.5" />
</system.web>    
<appSettings>
 <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> 
</appSettings>
</configuration>

Where password obviously includes my real password.

Here is what smarterasp.net provided as the connection string:

ASP.net "Server=MYSQL5012.Smarterasp.net;Database=db_9df63f_active;Uid=9df63f_active;Pwd=YOUR_DB_PASSWORD;"

Classic ASP "Driver={MySQL ODBC 5.1 Driver};Server=MYSQL5012.Smarterasp.net;Database=db_9df63f_active;Uid=9df63f_active;Password=YOUR_DB_PASSWORD;"

I also tried putting the connection string in the web.config file as connectionString= "Server=MYSQL5012.Smarterasp.net; Database=db_9df63f_active; Uid=9df63f_active; Pwd=MYPASSWORD;"

but this didn't work either.

Appreciate any help. Thanks!

1

1 Answers

0
votes

It looks like smarterasp.net does not allow remote database connections if you dont have a premium account. to solve that problem , after you publish your website, navigate to the file manager , on the root of your files on your website , there is a webconfig , edit it and modify the connection string there , replace it with the connection string given to you by the website database section.

on the websites webconfig file