ASP.Net MVC SQLExpress 生产环境更新场景
对于在 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="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\myappData.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些链接可能会在这方面帮助您
http://www.asp.net/托管/tutorials/strategies-for-database-development-and-deployment-cs
SQL Server 2005 - 同步开发/生产数据库
http://www.asp.net/hosting/tutorials/configuring-the-product-web-application-to-use-the-product-database-cs< /a>
这是同步数据库的付费解决方案
http://www.red-gate.com/products/SQL_Comparison_SDK/ case_studies/synchronizing_databases.htm
These links may help you in this regard
http://www.asp.net/hosting/tutorials/strategies-for-database-development-and-deployment-cs
SQL Server 2005 - Syncing development/production databases
http://www.asp.net/hosting/tutorials/configuring-the-production-web-application-to-use-the-production-database-cs
This is paid solution to sync databses
http://www.red-gate.com/products/SQL_Comparison_SDK/case_studies/synchronizing_databases.htm