Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listview Column Names

Status
Not open for further replies.

kissarmi

Programmer
Feb 14, 2002
72
0
0
US
Using a dataset (VB.Net) to fill a listview with records from a SQL Server table. How can I get the column names from the table to the column names on the listview?
 
Code:
        ListView1.View = View.Details

        For Each clm As DataColumn In currentTable.Columns
            ListView1.Columns.Add(clm.Caption)
        Next

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
May need this step?

Code:
Dim currentTable As DataTable = DataSet1.Tables("TableName")

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top