在asp.net中托管一个网站并连接到托管服务器以进行数据库连接 [英] host a website and connect to hosted server for database connection in asp.net

查看:62
本文介绍了在asp.net中托管一个网站并连接到托管服务器以进行数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello frens,



我是托管新手,我是第一次这样做。我需要托管一个由数据库驱动的网站。我以某种方式将网站文件从服务提供商提供给我的主机名和用户名,密码上传到托管服务器。但是关于与服务器的数据库连接,他们只向我提供了数据库名称,用户名和密码。在这种情况下,我该怎么做。



web.config中的数据库连接字符串是这样的。



< add name = myconnectionconnectionstring =Data Source = localhost; Initial Catalog = databasename; Integrated Security = true; User ID = ******; Password = *******>







因为我没有提供数据源我被要求使用本地主机但我怀疑这种连接是对的!! !请尽快回复。



此致,

Bishnu

提前谢谢

Hello frens,

i am a newbie for hosting and am doing it for the first time. I need to host a website which is database driven website. I somehow uploaded the website files to the hosted server from the host name and username, password which the service providers have provided me. But regarding the database connection to the server, they have provided me with database name, username and password only. In this case , how can i do that.

my database connection string in web.config is something like this.

<add name="myconnection" connectionstring="Data Source= localhost; Initial Catalog=databasename; Integrated Security=true;User ID=******;Password=*******">



since i am not provided with data source i have been asked to use local host but i doubt this connection is right!!! please reply asap.

Sincerely,
Bishnu
THanks in advance

推荐答案

如果您要指定用户ID&密码,那么您不想使用集成安全性。试试这个:

If you are specifying a User ID & Password, then you don't want to use Integrated Security. Try this:
connectionString="Data Source= localhost; Initial Catalog=databasename; Integrated Security=false;User ID=******;Password=*******"


如果没有提供那么用户ipaddress作为主机



connectionString =数据源= ipaddress;初始目录=数据库名称;集成安全=假;用户ID = ******;密码= *******



www.connectionstrings.com



问候....:)
if does not provided then user ipaddress as then host

connectionString="Data Source= ipaddress; Initial Catalog=databasename; Integrated Security=false;User ID=******;Password=*******"

www.connectionstrings.com

regards....:)


这篇关于在asp.net中托管一个网站并连接到托管服务器以进行数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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