what is your “item” datatype… is it the looping variable?
x.Item(“Owner”) - you need to check this, item will accept index where x is an array of string.
so instead of Owner you need to pass the index of Owner will work here?
when you are looping over each datatable, each datatable can have 0,1 or more rows
Your statement item.AsEnumerable.Select(… will run over all rows of the datatable of the current iteration. And therefore its returning not a single value as it has to be ready for above (…each datatable can have 0,1 or more rows)
Just give us some more details on requirements and datasamples, so we can help you on this
PFA input file, All the values are in number format in excel.
I need all the values from column A one by one inside the loop. Currently I am getting System.data.emumerable.rowcollection`1[System.string] as output. I need the output as 0.00, 0.00…and so on
PFA input file, All the values are in number format in excel.
I need all the values from column A one by one inside the loop. Currently I am getting System.data.emumerable.rowcollection`1[System.string] as output. I need the output as 0.00, 0.00…and so on
PFA my code sample, I need the id (distinct ID ) too which I already done here. I need to use this code (both id and that column value) as this values has to be updated to another sheet (using write range ) for that matching id in that sheet.
PLease help and suggest me changes in the attached file sample.
PFA input file, All the values are in number format in excel.
I need all the values from column A one by one inside the loop. Currently I am getting System.data.emumerable.rowcollection`1[System.string] as output. I need the output as 0.00, 0.00…and so on
@debashishforyou
Had a look on your xaml
are you debugging and inspecting what my statement is returning in the locals panels or do you just refer on what your message box is giving with: result.tostring?
@debashishforyou
I had a look on one of your provided XAMLs during my lunch break. As I cannot refer to the excel data I have to guess and cannot crosscheck.
What @vickydas provided as hint should help you in your flow.
In general it seems to me that you are trying to implement a lookup for an EmployeeID into another DataTable. If my understanding is right, then your Implementation has a chance to get reduced to much less activities. A lookup e.g. can be easy implemented with a LINQ Join statement.
So just give us feedback if you got run your implementation. If you want my help on refactoring then provide me some more details on the requirments and the required excel files or demo data
This code only gives me the value of the first cell and for the next iteration it is throwing error as below :
Index was out of range. Must be non negative and less than the size of the collection