Need to delete the empty column in the data table “dt_value” variable and pick the end cell value from the data table “dt_value”. Request fr a linq query to get the value as i tried a lot in it.
So i need to pick the value 123 from that unstructured sheet and column names are unknown and even initial columns will be deleted while processing
@Rahul_Maddy
@Kaviyarasu_N
If all rows have same number of columns data that is 4 in your case…we can try like this.
(From d In dtinput.AsEnumerable() Where Not(d.itemArray.All(function(x) String.IsNullOrEmpty(x.ToString))) Let ra = d.ItemArray.Where(function(x) Not String.IsNullOrEmpty(x.ToString)).Select(function(x) x.ToString) Select r = Dtoutput.Rows.Add(ra)).CopyToDataTable()
Cheers
check the reference thread
lrtetala
(Lakshman Reddy)
March 4, 2024, 9:32am
3
Hi @Rahul_Maddy
Can you please provide some sample input and output, meanwhile try the below code
DT.AsEnumerable().Last().Field(Of String)("Column")
Cheers!!
would it be possible to share your Input Data once… a kind of Image of your Input Data
I Updated the question with the image of my data table
lrtetala
(Lakshman Reddy)
March 4, 2024, 11:32am
6
@Rahul_Maddy
Try this
DT.AsEnumerable().Last().Field(Of Double)(3)
Cheers!!