You can only access GUI objects from the thread they were created on - if you try to access them from a different thread, you get the cross-thread error you are talking about. So you have correctly checked for invoke, and invoked if you need it.
Unfortunately, the same goes for creating controls - they can only be created on the UI thread.
So, try adding an
else
condition:
private void ListViewRows(object SqlQuery, ListView listView)
{
if (dataTable.Rows.Count < 1)
return;
if (listView.InvokeRequired)
listView.Invoke(new MethodInvoker(delegate { ListViewRows(SqlQuery, listView); }));
else
{
for (listViewRow = 0; listViewRow < dataTable.Rows.Count -1; listViewRow++)
{
Thread.Sleep(50);
ListViewItem listViewItem = listView.Items.Add(dataTable.Rows[listViewRow][0].ToString());
for (listViewCol = 1; listViewCol < dataTable.Columns.Count; listViewCol++)
listViewItem.SubItems.Add(dataTable.Rows[listViewRow][listViewCol].ToString());
}
}
}