2017-10-12 149 views
-3

我的网站,一个ASP.NET MVC应用程序,完美地在Visual Studio中使用数据库实体等工作。我想尝试将我的应用上传到GoDaddy的Plesk Web服务。ASP.NET MVC连接字符串

我来到这里的指南: http://www.c-sharpcorner.com/article/how-to-host-your-asp-net-mvc-website-on-godaddy-server/

它说,在第19步:“写连接字符串为您的服务器端的数据库。” 并在步骤20“再次打开Visual Studio并从包管理器更新数据库,再次在Visual Studio中的项目的web.config中编写相同的连接字符串。打开包管理器控制台并键入以下命令:”

任何人都可以你请给我一些建议这是什么意思的连接字符串?

+3

https://www.connectionstrings.com/connection-strings-explained/ – Steve

+0

它位于Web.config中,您只需要使用GoDaddy上的删除服务器的正确值更新,如服务器的ip地址,用户,密码和数据库名称 – Forlani

+0

软件包管理器控制台位于'Tools/NuGet软件包管理器/软件包管理器控制台' – derloopkat

回答

1

web.config文件中有连接字符串。 我使用实体框架,所以我的连接字符串按如下

< 添加名称= “yourEntityName”的connectionString =“元数据= RES:// /entity.csdl|res:///entity.ssdl | res://*/entity.msl; provider = System.Data.SqlClient; provider connection string = " data source = yourServerIpAddress; **** initial catalog = DataBaseName; persist security info = True; user id = YourId; password = YourPassword; MultipleActiveResultSets = True; App = EntityFramework "“providerName =”System.Data.EntityClient“/>

你必须改变你的连接字符串中的行,在我的conn中粗体行。串。