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
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,889 questions
0 comments No comments
{count} votes

Accepted answer
  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 Answers by the question author, which helps users to know the answer solved the author's problem.