ASP.Net MVC SQLExpress 生产环境更新场景

发布于 2024-09-25 17:35:46 字数 1090 浏览 1 评论 0原文

对于在 App_Data 文件夹中使用 sqlexpress 实际部署 Asp.Net MVC Web 应用程序来说,我将如何在数据库上线和使用后处理数据库更新。

这是我的场景和几个问题:

我有一个带有 sqlexpress 数据库的 Asp.Net MVC 2 Web 应用程序:[myappData.mdf,aspnetdb.mdf]。我计划将其发布到生产服务器,数据库包含在 App_Data 文件夹中。

问题 1

当我的网站正在使用并且用户已将新数据添加到数据库中并且我添加了一些需要添加一些结构数据库的新功能时,我将如何处理发布新数据库文件,同时保留所有用户已添加到数据库的数据?

问题 2

此外,一旦我开始在本地调试我的应用程序,我就无法在 sql Management Studio 中连接到它,我收到文件使用错误。因此,一旦它在生产服务器上上线并且用户遇到问题,我是否可以无法使用 sql management studio 浏览数据库?

问题 3

现在我正在使用以下 web.config 字符串连接到数据库,在安装了 sqlexpress 的生产环境中是否存在任何问题?:

<add name="myAppDataEntities" connectionString="metadata=res://*/Models.MyData_DB.csdl|res://*/Models.MyData_DB.ssdl|res://*/Models.MyData_DB.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myappData.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

感谢您提供的任何帮助挂这个。

New to actually deploying a Asp.Net MVC web application with sqlexpress in the App_Data folder, how would I handle database updates after it is live and in use.

Here's my scenario and a few questions:

I have an Asp.Net MVC 2 Web app w/ sqlexpress databases: [myappData.mdf, aspnetdb.mdf]. I was planning on publishing this to the production server with the databases included in the App_Data folder.

Question 1

When my site is in use and users have added new data into the database and I have added some new features which require some structural database additions how would I handle publishing the new database files while keeping all the data that users have added to the database?

Question 2

Also once I start debugging my app locally I can't connect to it in sql management studio, I get a file in use error. So once it goes live on the production server and a user is having a problem can I not browse through the database using sql management studio?

Question 3

Right now I'm connecting to the db with the following web.config string, are there any issues with this in a production environment that will have sqlexpress installed?:

<add name="myAppDataEntities" connectionString="metadata=res://*/Models.MyData_DB.csdl|res://*/Models.MyData_DB.ssdl|res://*/Models.MyData_DB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myappData.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />

Thanks for any help in getting the hang of this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文