实体框架:现有的数据库

编程入门 行业动态 更新时间:2024-10-28 05:28:36
本文介绍了实体框架:现有的数据库 - >数据模型 - >新的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我创建了一个新的项目MVC3和使用ADO.NET实体数据模型映射出我的现有数据库。它的工作太棒了。

I have created a new MVC3 project and used the ADO.NET Entity Data Model to map out my existing database. It worked great.

现在,这是一个数据库,我不想做我的web应用程序开发时的影响,所以我一直在寻找,现在附上数据模型到本地数据库(没有选择了一个没有,建议表示欢迎。我想的SQL Server CE或MySQL)。

Now, that is a database I don't want to affect when doing development of my web app, so I was looking to now attach that data model to a local database (haven't selected one yet, suggestions welcome. I was thinking SQL Server CE or MySQL).

有没有人对如何做到这一点任何想法?我会是不错的现有连接字符串保存到我的活动数据库,以及这种发展数据库环境。

Does anyone have any ideas on how to do this? I'd be nice to keep the existing connection string to my live database as well as this development database environment.

推荐答案

您可以使用任何你想要的技术(虽然这将是很好的,让他们像您的生产DB)生成另一个匹配DB,然后有一个Web.Debug和Web.Release设置。

You can generate another matching DB using whatever technology you want (though it would be good to keep them similar to your production DB) and then have a Web.Debug and a Web.Release setup.

如果你看一下换出的配置,web.config文件的连接字符串部分,你可以轻松地从发展交换到生产。

If you look at swapping out the configuration, connection string portion of your web.config file you can easily swap from development to production.

msdn.microsoft/en-us/library/ dd465326.aspx

这提供了在Web.config文件转换报表的相关信息,但是从它的声音,你可以简单地交换你的web.config的连接部分,并得到你想要的。

This provides the relevant information for the transform statements in your Web.config file, but from the sounds of it you can simply swap the connection portion of your web.config and get what you want.

更多推荐

实体框架:现有的数据库

本文发布于:2023-11-06 16:23:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564203.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实体   框架   数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!