imade this query and named it as vwOwnerAnimal. my problem is that i don't know how to display it using listview. can anyone pls help me.

SELECT tbowner.owner_code, tbowner.owner_name, tbowner.owner_add, tbowner.owner_cn, tbowneranimal.a_name, tbowneranimal.a_breed, tbowneranimal.a_age, tbowneranimal.a_sex
FROM tbowner INNER JOIN tbowneranimal ON tbowner.owner_code = tbowneranimal.owner_code;

4 Years
Discussion Span
Last Post by tinstaafl

Your first problem is using a ListView. It is not designed to be used with databases. However, a DataGridView will take a DataTable as a DataSource and will display whatever data you put in the datatable.

If you must use a ListView you'll have to do it the naive way. Return your query to a DataTable. Loop through the columns to replicate them in the Listview. Loop through the rows and build new ListViewItems based on the data in each row.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.