Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Emp_table

Sno Name Salary Country
1     XXXX   XXXX    101
2     XXXX   XXXX    102

Country Table

CID  CountryName
101       IND
102       USA

OutPUt

Sno Name    Salary    Country
1     XXXX       XXXX      IND
2     XXXX       XXXX      USA
Posted

1 solution

Create a model that has a property that will hold each of your data lists and return that to your view

C#
public class MyPageViewModel
{
    public List<table1> Table1 {get; set;}
    public List<table2> Table2 {get; set;}
    public List<table3> Table3 {get; set;}
}


C#
MyPageViewModel model = new MyPageViewModel();
model.Table1 = ....;
return View(model);


The view will then show the data in each property in its own table or grid or whatever.
 
Share this answer
 
v2
Comments
Member 11936584 26-Aug-15 4:50am    
Thank you., But where the condition means we are using two tables, two table data retrieve we use joins but you'r not using joins is it possible ??
F-ES Sitecore 26-Aug-15 5:04am    
If you meant you want to join multiple tables into a single result then how you do that isn't an MVC issue and depends on what you're using to interact with the database which you haven't said. If you're using ADO and sql\sps you use a JOIN, if you're using Entity Framework you need the "Include" method.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900