How to get the minimum of a specified row with a filtered column. on the DataTable with the select method

Mansour_Dalir 2,036 Reputation points
2023-06-01T11:41:29.13+00:00

hi

I have a select row with two filters. He is not replying

need Output row 5 with MyDataTable.Select() ..

Always be healthy .thank


       Dim MyDataTable As New DataTable
        MyDataTable.Columns.Add("Group", GetType(Integer))
        MyDataTable.Columns.Add("Level", GetType(Integer))
        MyDataTable.Rows.Add(1, 100) '1
        MyDataTable.Rows.Add(2, 70)  '2
        MyDataTable.Rows.Add(1, 60)  '3
        MyDataTable.Rows.Add(2, 50)  '4
        MyDataTable.Rows.Add(1, 40)  '5
        Dim DataRow() As DataRow = MyDataTable.Select("[Group]=1 And [Level]=Min([Level])")  'is Error
Developer technologies | VB
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    2023-06-01T12:41:19.28+00:00

    Hi

    I can not get any error. Screenshot shows the result I get from exactly your code.

    111


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.