A: 

Create a special object that contains two items of the types returned by your queries. Then you can access them with Model.depot and Model.Address in your View.

Catalin Florea
I'm not sure how to do that
Joshua Slocum
do you not know the types returned by the queries?
Catalin Florea
No i don't. I'm querying tables and filtering they by the id number which is entered by the user on the webpage.
Joshua Slocum
in your models folder. you could create a class that contains two fields. one for each list. i think you could use the types created by Entity Framework. then for the strongly typed view, select the class created with the two lists.
Catalin Florea
+1  A: 

You would need to create a ViewModel that has the following paramters:

public IQueryable<CSLA_DEPOT> depots {get; set;}
public IQueryable<CSLA_ADDRESS> addresses {get; set;}

You would then need to create an instance of this new View Model in your controller like so:

var model = new ViewModelName(){
    depots = db.CSLA_DEPOT.Where(c => c.DEPOT_ID == id.Value),
    addresses = db.CSLA_ADDRESS.Where(a => a.CSLA_DEPOT.DEPOT_ID == id.Value),
};

You would then need to pass this model to your view like so:

return View(model);

In your view you would access the two different collections like so:

Model.depots
Model.addresses

Hope this helps, leave me a comment if you have any questions.

DevDave
DevDave, I'm trying to implement this code and I'm getting an error. Added it to the question under the work EDIT. thanks
Joshua Slocum
Joshua, I had a bug in my code. Please note that the model is now referencing IQueryable for each variable instead of list. This should solve your problem.
DevDave
A: 

DevDave, thanks for the help. I'll try your advice when I get back to the office on tuesday.I'm out for the next 5 days.

Joshua Slocum