title: Cannot convert from int to system.collections.generic.icomparer<int>
body: <p>New to C# Just wondering what the error is, can't understand the error. No need to correct, just want to know the mistake. 
  ERROR:
  The best overloaded method match for 'Systems.Collections.Generic.List.BinarySearch(int,System.Collections.Generic.Icomparer)' has some invalid arguments
  Argument1: Cannot convert from system.collections.generic.list to int
  Argument2: Cannot convert from int to system.collections.generic.icomparer</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Text;enter code here
  using System.Windows.Forms;
  
  namespace LotoNumbers
  {
      public partial class FrmLotto : Form
  {
      // declare class level variables
      List&lt;int&gt; player = new List&lt;int&gt;(7);
      List&lt;int&gt; computer = new List&lt;int&gt;(6);
  
      public FrmLotto()
      {
          InitializeComponent();
      }
  
      // event method to generate player's numbers
      private void btnPlayer_Click(object sender, EventArgs e)
      {
          // declare and initalize local variables
          string display = "";
  
          // reset the winning number label before generating the player's numbers
          lblComputerNumber.Text = "00  00  00  00  00  00";
  
          // generate unique random numbers
          GenerateRandomNumbers(player);
          player.Sort();
          // build display string
          display = BuildDisplayString(player);
  
          // display winning number in label
          lblPlayerNumber.Text = display;
      }
  
      // method to generate computer's random numbers (the 'winning numbers')
      // and determine how many winning numbers
      private void btnComputer_Click(object sender, EventArgs e)
      {
          // declare and initalize local variables
          int winCount = 0;
          string display = "";
  
          // generate unique random numbers
          GenerateRandomNumbers(computer);
  
          // sort the array in ascending order
          computer.Sort();
  
          // build display string
          display = BuildDisplayString(computer);
  
          // display winning number in label
          lblComputerNumber.Text = display;
  
          // determine if this number matches any of the players numbers
          winCount = CompareTwoList(player, computer);
  
          // display the total winning numbers
          lblMatching.Text = winCount.ToString("D2");
      }
  
      private void GenerateRandomNumbers(List&lt;int&gt; numberList)
      {
  
  
          Random lucky = new Random();
  
          // generate unique random numbers
          for (int index = 0; index &lt; numberList.Capacity; index++)
          {
              int temp = lucky.Next(1, 50);
              if (numberList.IndexOf(temp) &lt; 0)
              {
                  numberList.Add(temp);
              }
              else
              {
                  index--;
              }
          }
  
      }
  
      private string BuildDisplayString(List&lt;int&gt; numberList)
      {
          // declare method variable
          string display = "  ";
  
          // loop through the array and build a display string
          foreach (int number in numberList)
              display += number.ToString("D2") + "  ";
  
          // return display string
          return display;
      }
  
      private int CompareTwoList(List&lt;int&gt; list1, List&lt;int&gt; list2)
      {
          // declare method variable
          int numberMatching = 0;
  
          // loop through each element in the first array looking for a match in the second array
          foreach (int value in list1)
          {
              if (player.BinarySearch(list2, value) &gt;= 0)
                  numberMatching++;  // a matching value is found
          }
  
          return numberMatching;
      }
  }
  </code></pre>
  
  <p>}</p>