无法在托管服务器上连接到我的数据库

问题描述:

我是网上主办网站的新手,因此我过去一周遇到了一个问题。我创建了一个动态网站,需要连接到主机服务器上的数据库,但是没有任何内容显示在应该保存从数据库中检索的数据的控件中。

我已经更改了数据源我的webconfig文件中的变量多次,但无济于事。我怀疑这是我的关系,这可能是问题所在。

这就是我现在正在做的事情:



Hi, I am new to hosting a website online and because of that, I have been encountering a problem for the past week. I have created a dynamic website which needs to connect to the database on the host's server but nothing shows up in the controls that are supposed to hold the data retrieved from the database.
I have changed the data source variable in my webconfig file several times but to no avail. And I am suspecting it's my connectionstring which may be the problem.
This is what I am doing right now:

<connectionStrings>
    <add name="ApplicationServices" connectionString="data source=host domain name;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=false"/>
    <add name="StudentDBConnectionString" connectionString="Data Source=host domain name;Initial Catalog=StudentDB;Persist Security Info=true;User ID=usermame;Password=password" />  </connectionStrings>









我很高兴,如果有人可以指导我如何解决这个问题。





I would be glad, if someone to could guide me on how to solve this problem.

通常托管服务提供商不允许通过连接字符串(DataDirectory)附加数据库,你必须明确地做这首先在数据库Web UI中。



但请联系您的提供商以获得更好的帮助。
Usually the hosting providers do not allow attaching databases via the connection string (DataDirectory) and you must explicitly do this in the database web UI first.

But contact your provider for better help.