无法在托管服务器上连接到我的数据库 [英] Having trouble connecting to my database on a Hosting Server

查看:106
本文介绍了无法在托管服务器上连接到我的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

我已经更改了数据源我的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.


这篇关于无法在托管服务器上连接到我的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆