当前位置: 移动技术网 > IT编程>开发语言>.net > 轻量ORM-SqlRepoEx (八)MySQL、Sql Service 迁移

轻量ORM-SqlRepoEx (八)MySQL、Sql Service 迁移

2018年10月11日  | 移动技术网IT编程  | 我要评论

9c8936,赤峰男科医院,搞笑鬼

数据库变更在编程应用中是常的,mysql、sql service之间的数据迁移更为常见,在 sqlrepoex2.0demoforaspcore 中演示了,这种数据库之间切换时sqlrepoex是如何的简单。中演示了,这种数据库之间切换时sqlrepoex是如何的简单。

第一步、增加sqlrepoex.mysql.servicecollection的nuget引用;

第二步、更改startup.cs文件中

      using sqlrepoex.mssql.servicecollection;

     using sqlrepoex.mysql.servicecollection;

第三步、更改connectionstring 字串为 string connectionstring = "datasource=127.0.0.1;username=test;password=test;database=northwind;charset=gb2312;sslmode = none;";


            然后,就没了

就这么简单,其他的不用改

就这么简单,其他的不用改

就这么简单,其他的不用改

 

 

为演示代码,我在mysql中增加了`customers` 个,其结构与数据与northwind数据库customers表相同。

源码见:

https://gitee.com/azthinker/sqlrepoex2.0demoforaspcore

https://github.com/azthinker/sqlrepoex2.0demoforaspcore

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网