Nagesh Bulbule

Nagesh Bulbule

  • NA
  • 187
  • 1.6k

How to show multiple database table data in one view in MVC

Aug 23 2016 12:17 AM
Hello, 
Below is my database example for understanding clearly
Database Name
Master1 & Master2 are different databases 
 
1. Master1
 
    Country
   (
      ID int,
     CountryName varchar(50)
   )  
 
2. Master2
 
   State
   (
      ID int,
      StateName varchar(50),
      CountryID int 
   )
 
There is no relationship on table
 
My question is
How to show these two table data into one view in asp.net mvc
 
I have one ViewModel as StateVM
One Controller as StateController 
 
so please clear me how to show data using entity framework and Join.
 
how to show data in State View with proper country name 
 
 

Answers (2)