当数据库连接字符串在运行时使用C #pragmatically更改时更新.edmx文件 [英] Update .edmx file when database connection string changes at runtime using C# pragmatically

查看:127
本文介绍了当数据库连接字符串在运行时使用C #pragmatically更改时更新.edmx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定在更改数据库时是否有自动更新edmx文件的方法。 

当前DbName =具有4个表的TestSolutionDB(国家,州,地址,用户)
更改DbName =具有4个表的ProjectDB(用户,项目,状态,活动)

当我替换连接字符串时,如
data source =。; initial catalog =TestSolutionTo
data source =。; initial catalog =ProjectDB

我需要更新.edmx文件(国家,州,地址,用户)TO(用户,项目,状态,活动)设计,和tt.file

这些所有项目都可以通过实际发生,可以给出解决方案吗?

谢谢





我尝试过:



但我对此没有任何想法,我是这个的新手

解决方案

这可能是一个解决方案在运行时为Entity Framework,WCF OData和动态客户端消耗动态生成的未知类 [ ^

I am not sure if there is a way to update edmx file automatically when database is changed.

current DbName = TestSolutionDB  with 4 tables (Country,State,Address,User)
Change DbName = ProjectDB with 4 tables(User,Project,Status,Activity)

When i replace the Connection string like 
data source=.;initial catalog ="TestSolution" To 
data source=.;initial catalog ="ProjectDB "

I need to update .edmx file (Country,State,Address,User) TO (User,Project,Status,Activity) Design, and tt.file 

These All Items can happened by pragmatically, Can give solution?

Thanks 



What I have tried:

Yet i don't have any idea about this, i am newbie for this

解决方案

This may be a solution Unknown Class Dynamically Generated at runtime for Entity Framework, WCF OData and dynamic client consumption[^]


这篇关于当数据库连接字符串在运行时使用C #pragmatically更改时更新.edmx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆