Dim connectionString As String = "AuthType=OAuth;Username=yourusername@yourtenant.onmicrosoft.com;Password=yourpassword;Url=https://yourorg.crm.dynamics.com;AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;LoginPrompt=Auto"
' Create a new instance of the CrmServiceClient
Dim svc As New CdsServiceClient(connectionString)
' Check if the connection is successful
If svc.IsReady Then
Console.WriteLine("Connection successful")
' Define query expression
Dim query As New QueryExpression("account")
query.ColumnSet.AddColumns("name", "revenue")
' Group by name and get maximum revenue for each group