Click here to Skip to main content
14,733,037 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
There have been many to show how to fill a listview with all the data from a database table but my question is if it's possible to append text in one field from a table to fill in two columns of a listview?

for example if I was to make a simple database table called Appearance and in the first field of that table I have (LongHair,BlueEyes)

How can I add LongHair to the hair Length column and BlueEyes to the Eye color column of my listview?

If this is possible I will work on my database format but if there is a easier way to take a field and its corresponding field to the right and add each tables field to the listview I would greatly like to know.

btw im using access database to learn from!.

1 solution

You can generate a database table based on the fields you choose.
A table can be created / modified via code.

Here[^] is a simple example.
Dale 2012 20-Feb-12 3:50am
I do not wish to create a data column on my windows form to then add or create tables to. I wish to return a string from a database table to two listview columns.

(Table) Appearance
(Cell Value)LongHair,BlueEyes (as one string divided by a ",")

(columns) Hair type Eye Color
(items) LongHair BlueEyes
Dale 2012 20-Feb-12 3:54am
examples or provided sample code preferably for

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