2
Reply

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

Nagesh Bulbule

Nagesh Bulbule

Aug 23 2016 12:17 AM
216
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)