-1
private void cbNomSociete_SelectedIndexChanged(object sender, EventArgs e)
{

  dgvListeAssemblee.DataSource = (
    from x in ListAssemble
    where x.Denomination
           .ToUpper()
           .Contains( cbNomSociete.SelectedItem.ToString().ToUpper() )
    select x
    ).ToList() ;

 }

how can this be fixed please

Nicholas Carey
  • 65,549
  • 13
  • 92
  • 133
  • This looks like a few other stack questions for example: http://stackoverflow.com/questions/16281133/value-cannot-be-null-parameter-name-source OR http://stackoverflow.com/questions/3244336/using-linq-to-find-item-in-a-list-but-get-value-cannot-be-null-parameter-name – drew_w May 07 '14 at 22:11
  • Debug it in Visual Studio. Enable the option "Break when exception is thrown" and you'll get the callstack. – Thomas Weller May 07 '14 at 22:11

1 Answers1

0

how can this be fixed please

Figure out which variable/property is null. Based on the error message, the exception is likely coming from a static Linq extension method (since they all have a first parameter named source), which would mean the most likely candidate is ListAssemble.

If x.Denomination or cbNomSociete.SelectedItem were null you'd see a different error message.

D Stanley
  • 144,385
  • 11
  • 166
  • 231