1.安装 mysql connector net 6.9.9 https://dev.mysql.com/downloads/file/?id=463758 和mysql for visual studio 1.2.6 2.nuget安装 Install-Package MySql.Data.Entity -Version 6.9.9 (版本号6.9.9和mysql connector net 6.9.9版本号一致) 3.添加ado.net实体数据模型
VS2013, MySQL5.7.18 , MySQL5.7.14 执行SQL语句: ztp_user z = new ztp_user(); object[] obj = new object[] { z }; MySqlParameter[] p = new MySqlParameter[]{ new MySqlParameter("@username","admin1") }; var result = db.Database.SqlQuery<ztp_