none
Is EF 4.1 Database-agnostic? RRS feed

  • Question

  • A few colleagues of mine worked with some Microsoft team members on a project and EF 4.1 was discussed. My colleagues swear that the MS guys told them that EF 4.1 was database-agnostic, which is important for our company because our applications need to support both Oracle and SQL Server.

    Is this true?

    For clarity, here's what database-agnostic means for us: We develop a single model and can "point" it to either an Oracle database or a SQL Server database by simply changing the connection string. Similar to what you can do with Enterprise Library DAAB.

    I'm thinking there was a nomenclature difference between what we consider database-agnostic and what the MS guys considered database agnostic.

    Friday, June 17, 2011 12:50 PM

Answers

All replies

  • Hi,

    You can use several DBMS'es by just changing the connection string as long as the provider supports the functionality needed! This is actually easier using code-first than model-/database-first which requires you to have several ssdl files to map.

    Hope this answers your question.


    --Rune
    Friday, June 17, 2011 1:39 PM
  • Sorry, Rune, but I am a little confused from your reply. You first say, "No", but then explain that it is possible.

    Thank you!

    Friday, June 17, 2011 1:44 PM
  • Hi again,

    Well... I need to re-read my posts before posting sometimes clearly :) I first wrote the text with a different approach, then the No would have been correct....

     

    But YES, it is possible to support several dbmses from EF4.1 by changing the connectionstring! Fixed my original post for this...


    --Rune
    Friday, June 17, 2011 2:47 PM
  • Hi Barry,

    Welcome!

    EF needs different Providers for different database, for Oracle you can refer this link: http://blogs.msdn.com/b/adonet/archive/2011/02/22/oracle-releases-beta-of-entity-framework-provider.aspx , we can dynamic choose providers according to connection string.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, June 20, 2011 8:54 AM
    Moderator
  • Hi Barry.

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 30, 2011 6:37 AM
    Moderator