在 Orchard MVC CMS 中更改数据库连接设置的位置 [英] where to change the Database connection settings in Orchard MVC CMS
问题描述
我在 Orchard CMS 中建立了一个站点.在选择数据存储设置时我选择了
I set up a site in Orchard CMS. While choosing data storage settings I chose
使用现有的 SQL Server(或 SQL Express)数据库
Use an existing SQL Server(or SQL Express) database
代替
使用内置数据存储(SQL Server compact)
Use built-in data storage(SQL Server compact)
它对我来说效果很好,但我想知道在哪里更改作为数据库服务器名称的数据源.我在 web.config
文件中没有找到连接字符串设置.
It has worked fine for me but I am wondering where to change the data source that is the database server name. I didn't find the connection string settings in web.config
file.
推荐答案
要更改数据库,您应该编辑 App_Data\Sites\Default\settings.txt
DataConnectionString
条目/code> 文件.
To change the database, you should edit the DataConnectionString
entry in the App_Data\Sites\Default\settings.txt
file.
它应该看起来像这样:
Name: Default
DataProvider: SqlServer
DataConnectionString: Data Source=servername;Initial Catalog=dbname;User Id=username;Password=password;
您确实需要在更改后重新启动网站.如果您自己无法重置网络服务器,则在 web.config
(添加一个空格)或 bin
目录中进行编辑就足够了.当此文件或文件夹中发生某些事情时,.NET 会重置网站.
You do need to restart the website after the change is made. If you can't reset the webserver yourself, edit in the web.config
(add a space) or in the bin
directory should suffice.
.NET resets the website when something happens in this file or folder.
这篇关于在 Orchard MVC CMS 中更改数据库连接设置的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!