Using a DataTable:
public static void LoadListView(ListView lv, DataTable table)
{
if(table != null)
{
for (int i = 0; i < table.Columns.Count; i++)
{
ColumnHeader header = new ColumnHeader();
header.Text = table.Columns[i].ColumnName;
lv.Columns.Add(header);
}
foreach (DataRow row in table.Rows)
{
ListViewItem lvi = new ListViewItem(row[0].ToString());
for(int i = 1; i < table.Columns.Count; i++)
{
item.SubItems.Add(row[i].ToString());
}
lv.Items.Add(lvi);
}
}
}