i need your help to remove null and empty values in DataTable. My Excel table 4678 rows but returning rows more than 1000000 i need to remove empty or null ... Also MY COLUMNS COUNT 60!!! :( please help me
foreach (var sheet in Sheets)
{
dbCommand = new OleDbCommand("select * From[" + sheet + "$]", excelConnection);
System.Threading.Thread.Sleep(1000);
this.Invoke((MethodInvoker)delegate
{
listBox1.Items.Add("Tablo ismi: " + sheet.ToUpper(CultureInfo.InvariantCulture) + " Tablo Satır Sayısı: "+ dSet.Tables[sheet].Rows[0][0].ToString());
});
dataAdapter = new OleDbDataAdapter(dbCommand);
dTable = new DataTable();
dataAdapter.Fill(dTable);
dTable.TableName = sheet.ToUpper(CultureInfo.InvariantCulture);;
bool isEmpty = true;
for (int i = 0; i < dTable.Rows.Count; i++)
{
isEmpty = true;
for (int j = 0; j < dTable.Columns.Count; j++)
{
if (string.IsNullOrEmpty(dTable.Rows[i][j].ToString()) == false)
{
isEmpty = false;
break;
}
}
if (isEmpty == true)
{
dTable.Rows.RemoveAt(i);
i--;
}
}
ArrangedDataList(dTable);