find withdrawal amt column value index number in datatabe …
| Value Dt | Withdrawal Amt. | Deposit Amt. |
|---|---|---|
| 01/05/24 | 270000 | |
| 01/05/24 | 2967 | |
| 02/05/24 | 50000 | |
| 02/05/24 | 104400 | |
| 02/05/24 | 42000 | |
| 02/05/24 | 32000 |
find withdrawal amt column value index number in datatabe …
| Value Dt | Withdrawal Amt. | Deposit Amt. |
|---|---|---|
| 01/05/24 | 270000 | |
| 01/05/24 | 2967 | |
| 02/05/24 | 50000 | |
| 02/05/24 | 104400 | |
| 02/05/24 | 42000 | |
| 02/05/24 | 32000 |
Try this
columnIndex = DataTable.Columns.Cast(Of DataColumn).ToList().FindIndex(Function(c) c.ColumnName = "Withdrawal Amt.")
Regards,
columnIndex = DT.Columns.Cast(Of DataColumn).ToList().FindIndex(Function(c) c.ColumnName = "Withdrawal Amt.")
Input:

Output:
Regards,
i need withdraw column values index number example i have four values of withdraw column find that index number
Can you please elaborate and what is expected output from above input
index = String.Join(vbcrlf,Enumerable.Range(0, dt.Rows.Count).Where(Function(i) Not String.IsNullOrEmpty(dt.Rows(i)(dt.Columns.Cast(Of DataColumn).ToList().FindIndex(Function(c) c.ColumnName = "Withdrawal Amt.")).ToString.Trim)).ToList())
Input:

Output:
Regards
my out put is 0,1,4,5
Try this
String.Join(", ", DT.AsEnumerable().Select(Function(row, index) New With {.Row = row, .Index = index}).Where(Function(x) Not IsDBNull(x.Row("Withdrawal Amt.")) AndAlso Not String.IsNullOrEmpty(x.Row("Withdrawal Amt.").ToString())).Select(Function(x) x.Index).ToList())
Regards,
please attach sequence files…
how remove that rows in datatable
Do you want to remove that index number rows from the datatable. Please specify.
Regards
yes… how to remove that index number in datatable
Check the below workflow
The below workflow will store the index in a list variable and remove those rows from the data table.
Sample Process 7.zip (35.6 KB)
Regards
is not working provide another
What isn’t working in your case. Can you share it with screenshots @domsmgtmeet22. SHare you expected Output here.
Regards