简体   繁体   English

使用数据库将Asp.net网站托管到托管服务器

[英]Hosting Asp.net web site with DataBase to hosting server

I have developed an e-comm web site in asp.net with sql server as a database. 我在asp.net中开发了一个以sql server作为数据库的电子商务网站。 Now I want to upload that web site with DB to hosting server. 现在,我要将带有DB的网站上传到托管服务器。

This is my first web hosting and I don't know how to do it. 这是我的第一个虚拟主机,我不知道该怎么做。

I've created the DB script to recreate the DB at the hosting server, but I don't know how to run it on server. 我已经创建了数据库脚本来在托管服务器上重新创建数据库,但是我不知道如何在服务器上运行它。 Please tell me how to do this. 请告诉我该怎么做。

Please tell me what changes need to be done in my connection string in web.config file for connecting the DB which will be on hosting server. 请告诉我需要在web.config文件中的连接字符串中进行哪些更改以连接将位于托管服务器上的数据库。

My connection string is: 我的连接字符串是:

<add name="DBCS" connectionString="data source=(local)\SQLEXPRESS;database=LAAFOOD;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>

I also have ftp client "Filezilla" which i am able to use for uploading static html pages on server. 我也有ftp客户端“ Filezilla”,可以用来在服务器上上传静态html页面。

Also tell me, are there any kind of free hosting services available for testing my E-comm web site online? 还告诉我,是否可以使用任何类型的免费托管服务在线测试我的E-comm网站?

Thanx in advance. 提前感谢。

You will need to change the connection string in web.config from your local db to the connection string for the remote db. 您需要将web.config中的连接字符串从本地数据库更改为远程数据库的连接字符串。 Upload your web.config. 上载您的web.config。 Alternatively you can comment out the local string and just the remote connection string. 或者,您可以注释掉本地字符串,而仅注释掉远程连接字符串。 That way you can switch as needed when testing locally. 这样,您可以在本地测试时根据需要进行切换。

You will also need to create the remote db too. 您还需要创建远程数据库。 You can use Sql Management studio to connect to the remote db and run the sql script to create the db. 您可以使用Sql Management Studio连接到远程数据库,然后运行sql脚本来创建数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM