想通过oledb或者odbc连接数据库
connectionString尝试了很多写法,都不成功
该怎么写?
错误信息
‘this.Database.CurrentTransaction’ threw an exception of type 'System.Data.Entity.Core.ProviderIncompatibleException'
web.config配置文件中配置: <connectionString>
      <add name="TestOledb" providerName="System.Data.OledDB">
               connectionString="Provider=SAOLEDB.17;uid=dba;pwd=sql;Links=TcpIp(host=.;serverport=5000);eng=demodb"/>
      
      <add name="TestODBC" providerName="System.Data.Odbc">
               connectionString="Driver={SQL Anywhere 17};uid=dba;pwd=sql;dsn=demo db;database=demodb;"/>
 <connectionString>
创建dbcontextpublic class DemoDB :DbContext
{
       public DemoDB() : base("name=TestOledb") //用TestODBC也一样的错误信息
       {}
}

解决方案 »

  1.   

    entityFramework支持anywhere?它的支持类库是哪个?
      

  2.   


    用odbc或者oledb可以吗
      

  3.   


    用odbc或者oledb可以吗
    好像不支持的吧
      

  4.   

    entityFramework 目前只有sqlserver
      

  5.   


    用odbc或者oledb可以吗
    你如果理解EF的原理,就知道应该不行。ORM是需要SQL翻译的,那么翻译SQL的代码在哪里?不可能是.net自带的dll,必须是新的支持库dll。
    sqlserver是:EntityFramework.SqlServer.dll
    mysql是:MySql.Data.Entity.EF6.dll那么,你找到 EntityFramework.Odbc.dll了吗?
      

  6.   

    有MySQL和oracle,其他的好像见过第三方的一些。
      

  7.   

    sqlite也支持
    System.Data.SQLite.EF6.dll
      

  8.   

    https://www.cnblogs.com/LoveSuk/p/6739642.html   这个有提到sql anywhere  但也是提到
      

  9.   

      这里面 也只说ef 支持 SQLanywhere
      

  10.   

    不清楚,爱莫能助
    https://blog.csdn.net/apollokk/article/details/5609182
      

  11.   

    通过NuGet导入Sap.Data.SQLAnywhere.EF6,Entity Framework support