association of more than one model to a listview
Posted
by Veer
on Stack Overflow
See other posts from Stack Overflow
or by Veer
Published on 2010-04-16T20:17:54Z
Indexed on
2010/04/16
20:23 UTC
Read the original article
Hit count: 236
I have 3 Tables in my database. Each table has 3 fields each, excluding the ID field. out of which 2 fields are of type nvarchar. None of the tables are related.
My ListView in the application helps the user to search my database, the search being incremental. The search includes the nvarchar fields of the 3 tables ie, 6 fields in total.
Eg:
- PhoneBook: Name, PhoneNo
- Notes: Title, Content
- Bookmarks: Name, url
I've the models generated for the 3 tables.
Now the ListBox should display the Ph.Name, Title and the Bo.Name fields. ie, It should be bound to them. But they are from different models. I also should be able to perform CRUD operation on the item searched. How would i do that?
P.S: Separate ViewModels are created for each Model which are used for their respective views for handling those tables individually. But this is an integrated view where the user should be able to search everything.
Also please somebody suggest me a better Title for this question:)
© Stack Overflow or respective owner