Reputation: 1
i m creating a mvc website in which i want to access more then one table through videwdata.model, how can i do like this or it can do by another way.plz help me
Upvotes: 0
Views: 207
Reputation: 1038780
Views/ASPX pages shouldn't access database. They should only work with the view model which is passed by the controller. Neither the controller should know anything about a database. It uses a service layer which fetches data from somewhere (in your case multiple databases) and returns a model object. In the specific implementation of the service you could perform multiple queries from different databases.
Upvotes: 2