How to skip blank rows in data table in C# using LINQ

  • Thread starter Thread starter Gani tpt
  • Start date Start date
G

Gani tpt

Guest
I'm using data table which contains more than 100 columns.

In my data table most of the rows are blank.

I don't want to read all the rows, if the rows are blank. then the rows suppose to skip.

because it takes more time to read the rows and columns even if the blank.

sample data is below:

EmpNo Name Sal Sec

A101 Ajesh A

A102

A103

A104 James 1000

A105

A106 Rubin 2000 ZZ

below is my code
----------------


for (int i = 0; i < dt.Rows.Count; i++)
{

//Need to check the condition for blank
//if rows are blank then skip using linq

??????

for (int j = 0; j < dt.Columns.Count; j++)
{
//Do some process
}
}
Note : Except first columns remaining have to check the blank cells. because first columns has unique and values always will be there.

Continue reading...
 
Back
Top