1

I want to have access to 2 different databases in Ado.net Entity framework. I created one .edmx file in project, how can i access two different database in single .edmx file Database provider is MySQL.

Regards, venkateswararao

3 Answers 3

1

Are two databases are same or different?

If same than you can use one emdx against both, you just have to create 2 dabase context objects with 2 different connection strings.

If they are different than you have to create 2 different emdx files.

Sign up to request clarification or add additional context in comments.

1 Comment

they are different Databatabases I haver created two edmx files and i have resolve the issue thank you
0

It is not possible. You must have separate EDMX file (and context) for each database. There are some ugly workarounds like exposing tables from second database via views in the first database (so EDMX talks only to the first database) but that brings other problems because views are read only in EF unless you create CUD stored procedures for every table exposed as a view.

1 Comment

Thank you very much for spending your valuable time to give Resolve my issue
0

Preparing an Entity Framework model for multi provider support

Look To This Go To Link

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.