-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

2

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.