headshat1k
New Member
I am new to .net. I have a form in which there are two comboboxes \[code\]cbProduct\[/code\] and \[code\]cbBrandName\[/code\] and also a label \[code\]lblPrice\[/code\]. I am trying to implement the below code but it is showing blue scribbles to \[code\]&&\[/code\]. (Error: operator '&&' cannot be applied to operands of type 'lambda expression' and 'lambda expression')I tried the below code: (not working)\[code\]lblPrice.Text = string.Empty; lblPrice.Text = doc.Descendants("items" ).Where((x => x.Element("productname" ).Value.Equals(cbProduct.SelectedItem.ToString())) && /*blue scribbles to '&&'*/ (y => y.Element("brandname").Value.Equals(cbBrandName.SelectedItem.ToString() ))).Select(k => k.Element("price" ).Value).ToString();\[/code\]My other question is that i want to make the selected values of \[code\]cbProduct\[/code\] as distinct. The below code takes all the values instead of distinct values:\[code\]cbProduct.Items.AddRange(doc.Descendants("items" ).Select(x => x.Element("productname").Value ).ToArray<string>());//adds all products cbProduct.SelectedIndex = 0;\[/code\]giving any one answer is okPlease assist me
Thanks in advance
Thanks in advance