I am trying to put database information into a listview. The database consists of:
ID
LastName
FirstName
Extention
Department
There are 15 records and each record is in the following format based on the above columns
100 Simpson Homer 2342 Animation
I would like to display each record in the same format with ID, LastName, FirstName, Extention, Department. I am able to add rows in with 1 column and no matter where I look I can't find how to do multiple columns to display all the data
My database is internally vb.net. I have 15 records, and this happens currently in form.load
'Form onLoad Event (Executes once the form has loaded)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.EmployeesTableAdapter.Fill(Me.EmployeeDataSet.Employees)
Dim row As EmployeeDataSet.EmployeesRow
'Setting the view type for list view (can also be done in the form properties)
lstvEmployees.View = View.Details
'Creating Columns in the List View
lstvEmployees.Columns.Add("ID", 120, HorizontalAlignment.Left)
lstvEmployees.Columns.Add("Last Name", 120, HorizontalAlignment.Left)
lstvEmployees.Columns.Add("First Name", 120, HorizontalAlignment.Left)
lstvEmployees.Columns.Add("Extension", 120, HorizontalAlignment.Left)
lstvEmployees.Columns.Add("Department", 120, HorizontalAlignment.Left)
' Itterates Through each row in the Employees Database
For Each row In EmployeeDataSet.Employees.Rows
lstvEmployees.Items.Add(row.ID.ToString)
Next
End Sub
Thank you for your help, I hope I left enough information and I hope the documentation helps others who are not familiar with list views and databases.