none
How to connect to an SQL Linked server RRS feed

  • Question

  • Hi, I have an Access database file (mdb) that I want to work with it using EF 4, so I created a linked server in SQL Server, and now I can't create a connection string, I don't know how to connect to it, any idea ? I am Using Code First

    AAK

    Saturday, August 11, 2012 2:01 PM

Answers

  •   

    Don't know. In looking into the issue I have found that EF 4.0 has issues with creating table names using the linked server name as part of the name. Now if you just need to get data from the database the answer to the issue is to hide the linked server behind a View having the View connect to the Linked server.

    Hope that helps.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Proposed as answer by Doraemon_3 Thursday, August 16, 2012 2:04 AM
    • Marked as answer by Alexander Sun Thursday, August 16, 2012 2:22 AM
    Saturday, August 11, 2012 8:40 PM

All replies

  • Hi AAK;

    MS Access is not supported out of the box by Entity Framework. There are some third party that have implemented an ODBC driver to support it but I have not tried them. Please see the following links to research how does support this. Also please note that a provider may only currently support a previous release of Entity Framework such as EF 3.5.

    ADO.NET Data Providers & Third-Party Providers

    .NET Framework Data Providers (ADO.NET)


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Saturday, August 11, 2012 4:53 PM
  • I know that MS Access is not supported, but I believe that SQL Linked server is supported in EF. So I created one (a linked server) but I don't know how to connect to it, what the connection string should look like ?

    AAK

    Saturday, August 11, 2012 7:47 PM
  •   

    Don't know. In looking into the issue I have found that EF 4.0 has issues with creating table names using the linked server name as part of the name. Now if you just need to get data from the database the answer to the issue is to hide the linked server behind a View having the View connect to the Linked server.

    Hope that helps.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Proposed as answer by Doraemon_3 Thursday, August 16, 2012 2:04 AM
    • Marked as answer by Alexander Sun Thursday, August 16, 2012 2:22 AM
    Saturday, August 11, 2012 8:40 PM