none
Lead Table To another table in differnt database

    Question

  • For example we have a Database A have one table ' A1 ', and second database B have one table ' B1 '.

    A and B are not symmetric (Don't have the same table).

    A1 and B1 are symmetric (Have the same columns).

    Situation : I want to get rows value in B1, but by access to the table A1.

    In a .Net MVC solution, I have an entity framework Model created from ' A ', but I want to use the same model(Created from A) for access to the values in the table B1 in B (A1 and B1 are symmetric).

    How ?

    Thanks in advance,

    • Moved by CoolDadTx Thursday, March 28, 2019 2:04 PM EF related
    Thursday, March 28, 2019 1:12 PM

All replies

  • What's wrong with using ADO.NET, MS SQL Command objects and T-SQL?
    Thursday, March 28, 2019 2:46 PM
  • Hi,

    >> I want to get rows value in B1, but by access to the table A1.

    Sorry, I could not fully understand your need. Could you elaborate on the meaning of the above sentence?

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 29, 2019 6:50 AM
  • In the first, i was have one database contain many tables, and in my solution i created a model from this database(edmx),then in sql server i created another database containt some table from the first database.

    So in some part in my solution, i need to work with this new database, by used the same model, and i don't need to create a new model from the new database because I have to change everything.

    So how can i access to the new database() from my model.

    explanation

    Friday, March 29, 2019 8:37 AM
  • Hi,

    Based on my search results, when create EF from database, one "edmx" corresponds to a database. So, in the "edmx" of one database, you can't access another database.

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 1, 2019 9:54 AM