will the query delete the duplicate values or omit it…i dont want to delete the duplicates it has run in the loop and when the condition is met it should take the next invoice number
sure, we will assist. Just go through the shared resources and come back with your specific questions. Feel free to illustrate your needs with a more detailed output result
When it is about to get back all ColumnB values whicha are Unique and not duplicated we would do:
arrUniqueValues | String array =
(From d In dtData.AsEnumerable
Group d By k=d("Client").toString.Trim Into grp=Group
Where grp.Count = 1
Select v=k).toArray
but with your samples, the result will be an empty string Array
use immediate panel. type in arrUniqueValues and check the array
we assume that it is empty as we shared the reason above
or ther is only one item inside, then using (1) would fetch the second item, but there is no second item.
Let us cut-off the ping-pong conversation. We recommend that you re-read all the posts from above and train some more basics a little bit more. Simply practice a few selected sub-steps of the overall modeling and then integrate them into the final process.
Just take your time and get pick-up once you are ready.
1 Get the excel sheet get the distinct value process the same
var distinctValues = dataTable.AsEnumerable()
.Select(row => row[columnName]) // Project each row to the desired column value
.Distinct() // Get distinct values
.ToList(); // Convert to a List (optional)
2 Push the data into DB
You can push data into database and put the logic for duplicate checks and process the unique record