c# 3.0 - A better way of handling the below program(may be with Take/Skip/TakeWhile.. or anything better) -


I have a data table that has only one line but it has 44 columns. My job is to get the columns from the 4th row to the end.

After this, I have done the program below which is in line with my requirement. (Please note that the dt is datable)

  list & gt; Decimal & gt; LstDr = new list & lt; Decimal & gt; (); Numerical (0, dt.Column.Count). List (). ForEach (i => {if (i> 3) lstDr.Add (convert toDecimal (dt.rows [0] [i]));});  

There is no harm in the program. Okay, the works are fine.

But I think there might be a better way for the program, take op or take or some other stuff.

I am looking for a better solution

Is this possible?

I am using C # 3.0

Thank you.

It should do this:

  list & lt; Decimal & gt; LstDr = dt.rows [0] .imare Skip (3). Selection (O = & gt; Convert. ToDecimal (o)) .Oolist ();  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -