Mysql –>EF edmx(model first)–> Sql server table
- 一、mysql environment
When we create an new database,first We need draw er diagram for somebody to show your idea,but our company have no good
authorised tool to design sqlserver ER diagram,so I use mysql graphical tool to design it, after that,you can use mysql to create edmx
us entityframwork,and use this edmx to create new sqlserver database or table.The following is details:
1、first you need install mysql,the download address is http://dev.mysql.com/downloads/windows/installer/,this version is no need to install,

after that,you need install mysql,the install detail and config,you can see the article.
http://laizetian.blog.51cto.com/10728827/1786180,
for operating mysql database conviniently,you can download grapahics tool workbencn
https://dev.mysql.com/downloads/workbench/.
after you create new datatable use mysql.
二、EntityFrameWork 6.0.0.0 connect Mysql to create EF
you can folling the article to install http://www.cnblogs.com/dunitian/p/4755585.html
note:(1)you need install MySQL for Visual Studio and Connector/Net correctly,otherwise you will happen some terrible,
for example;you will not find mysql Databse option。

(2)if you have isntall ef,but don't find ADO.Net entity Data Model,maybe you have make something wrong,you
can uninstall Entity framework at control panel and reinstall it.


三、EF edmx create sqlserver database。
1、you can use Generate Database from Model to create sqlserver table

2、change connection Type to Sql server and connect to database you want to create table

2、Next you will meet the following error

you need change edmx file xml,click right mouse on edmx file,and you will find the following and
edit。

use
<Schema Namespace="RightsDataModel.Store" Provider="System.Data.SqlClient" ProviderManifestToken="2012" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
replace <Schema Namespace="mydbModel.Store" Provider="MySql.Data.MySqlClient" ProviderManifestToken="5.7" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
after that,you build project,you will find the following error,you need delete Precision and rebuild again.
If you want define table column type,you can define at this palce,and it will affect database table type。

After that,you can use Generate Database from Model ,you can see the following window means
it is success,you can copy script to sqlserver studio to execute it or not。

Mysql –>EF edmx(model first)–> Sql server table的更多相关文章
- mySql学习笔记:比sql server书写要简单
在学mySql.总的感觉,mySql与Sql Server差不多,语法都很象,但mySql也许是吸取了SQL SERVER的一些经验,SQL语句书写起来更加简单. 比如说,设置主键.索引,SQL SE ...
- mysql 内置函数和sql server 内置函数的区别
以下函数均没有对参数做说明,使用的使用需要了解其参数内容 数据库 sql server mysql oracle 举例 获得当前系统时间 getdate() now() sysdate 注意不是函数 ...
- .Net EF Core数据库使用SQL server 2008 R2分页报错How to avoid the “Incorrect syntax near 'OFFSET'. Invalid usage of the option NEXT in the FETCH statement.”
一. 问题说明 最近.Net EF core 程序部署到服务器,服务器数据库安装的是SQL server 2008 R2,我本地用的的是SQL server 2014,在用到分页查询时报错如下: H ...
- MySql的数据导入到Sql Server数据库中
步骤一:安装MySql驱动 驱动下载链接:https://dev.mysql.com/downloads/connector/odbc/ 下载完成后安装, 一路Next即可 步骤二:创建DSN DSN ...
- 2019-03-28 SQL Server Table
-- table 是实际表 view是虚表.你可以认为view是一个查询的结果 -- 声明@tbBonds table declare @tbBonds table(TrustBondId int n ...
- 数据库 SQL Server 到 MySQL 迁移方法总结
最近接手一起老项目数据库 SQL Server 到 MySQL 的迁移.因此迁移前进行了一些调查和总结.下面是一些 SQL Server 到 MySQL 的迁移方法. 1. 使用 SQLyog 迁移 ...
- SQL Server和MySQL数据库
导读:接下来的网上商城的项目,需要用到MySQL数据库了.这个对于我来说,是一个新接触的东西,按照惯例,在刚开始学习一个东西的时候,先从宏观上去了解它.本篇博客,先介绍SQL Server的基本内容, ...
- 从SQL Server到MySQL,近百亿数据量迁移实战
从SQL Server到MySQL,近百亿数据量迁移实战 狄敬超(3D) 2018-05-29 10:52:48 212 沪江成立于 2001 年,作为较早期的教育学习网站,当时技术选型范围并不大:J ...
- abp项目 从sql server迁移至mysql
官方资料:https://aspnetboilerplate.com/Pages/Documents/EF-MySql-Integration 实验发现,还差了两步 整理一下,步骤如下: 1.引用My ...
随机推荐
- ExtJs 可查询的下拉框
最近项目中有个需求,就是有四个模块需要加载一个主表的内容,比如说这个表叫项目表(比如项目表里有两个字段一个是项目ID--projCd,还有一个是项目名称--projNm).主表的内容的要放在一个下拉框 ...
- Openvswitch原理与代码分析(6):用户态流表flow table的操作
当内核无法查找到流表项的时候,则会通过upcall来调用用户态ovs-vswtichd中的flow table. 会调用ofproto-dpif-upcall.c中的udpif_upcall_hand ...
- 尝试在tensorflow上运行facenet
上一篇装好了tensorflow的运行环境,开始尝试运行一些实例代码,在github上找到了一个tensorflow实现的facenet的代码,还是遇到了很多坑! 坚持看完,有重要总结! 代码:htt ...
- Mac安装win7
为了给老板的mac air装上win7,研究了大致4-5小时,终于搞定! 新版的air安装实在是太不容易了,现在记录如下: 制作硬件:8G优盘一个(至少大于6G空白优盘一个),Macbook ai ...
- Android Studio开发JNI工程
转:http://www.2cto.com/kf/201412/361768.html 使用Android Sutdio创建一个新的工程后,接下来记录创建NDK工程的基本步骤. 本文将达到: 1. 创 ...
- javascript 无语的==
今天面试不小心掉进坑了,大公司特别喜欢考javascript,而且专门挑很tricky的case. javascipt的==简直就是黑魔法,以前偷懒总是用,感觉也没有问题,可是准备面试就需要有寻根问底 ...
- 通过 Storyboard 快速搭建一系列连贯性的视图控制器
此例子只是一个简单的 Demo,这里没有过多介绍如何去实现,网上有很多关于 Storyboard 技术的介绍,请自行搜索. 效果如下: iPhone 5s iPhone 6 iPhone 6 ...
- 年底奉献-QT编写视频监管平台(开源)
忙忙碌碌又是一年,算算自己毕业四年半,一直在现在这家公司做研发外加总经理助理,研发起初用的VB.NET,而后全面转为C#,最后又全面转为QT,都是由于项目需要,算下来自己搞QT编程也已经四年了,201 ...
- sap IRfcTable 转成 DataTable
public DataTable GetDataTableFromRFCTable(IRfcTable myrfcTable) { DataTable loTable = new DataTable( ...
- Java中删除文件、删除目录及目录下所有文件(转)
原文链接:Java中删除文件.删除目录及目录下所有文件 知识点:File.delete()用于删除“某个文件或者空目录”!所以要删除某个目录及其中的所有文件和子目录,要进行递归删除,具体代码示例如下: ...