实体框架6.0和Mysql在批量更新中给出错误

时间:2015-04-23 19:33:01

标签: c# mysql entity-framework entity-framework-6

我有一个使用MySql DBMS运行的项目,但由于一些批量插入功能和批量更新,我不得不将项目升级到Entity Framework 6.0,但现在每次我都会尝试在数据库,它给出以下错误:

  

您的SQL语法有错误;检查手册   对应于您的MySQL服务器版本,以便使用正确的语法   靠近'[relatoriocredito_debug]。 [tb_pagar] SET \ r \ n [pag_baixado] =   's',\ r \ n [pag_databaixa]'在第1行

我的理解是他使用的是Microsoft SQL Server和MYSQL的语法,而不是像他一样使用MySQL语法?

我使用的连接器是最新版本,下面也是我的app.config

<? xml version = "1.0" encoding = "utf-8"? >
<configuration>
  <configSections>
  <!--For more information on Entity Framework configuration, visit-http://go.microsoft.com/fwlink/?LinkID=237468->
    <section name = "entityFramework" type = "system.data. Entity. Internal. ConfigFile. EntityFrameworkSection, EntityFramework, Version 6.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" requirePermission = "false"/>
  </configSections>
  <connectionStrings>
    <add name = "relatoriocredito_debugEntities" connectionString = "metadata = res://*/res://*/Mappings.EF.ssdl Mappings.EF.csdl | | */res://Mappings.EF.msl; provider = MySql.Data.MySqlClient; provider connection string = server = &quot; 10.32.71.77; user id = * * * * * * *;p assword = *** * * * * *;p ersistsecurityinfo = True; database = relatoriocredito_debug; allowuservariables = True providerName =" &quot; "/" System.Data.EntityClient >
  </connectionStrings>
  <entityframework>
    <defaultconnectionfactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework" >
      <parameters>
        <parameter value = "mssqllocaldb"/>
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6"/>
    </providers>
  </entityFramework>
  <runtime>
    <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentassembly>
        <assemblyidentity name = "EntityFramework" publicKeyToken = "b77a5c561934e089" culture = "neutral"/>
        <bindingredirect oldVersion = "0.0.0.0-6.0.0.0" newVersion = "6.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

0 个答案:

没有答案