このコードで:
comboBoxCurrently.DataSource = PlatypusData.getCurrentlyVals();
comboBoxCurrently.Items.Remove("Surrounded by purplish-blue Penguins");
...「System.ArgumentException was unhandled Message=Items collection cannot be modified when the DataSource property is set.」というメッセージが表示されます。
後でクエリ内から削除する値 ( ...WHERE bla <> 'Surrounded... )を制限したくありません。その値が (履歴データを表示するために) 許可されている場合があるためです。 getCurrentlyVals()に条件付きステートメントが必要なのは、どちらか一方のクエリ ステートメントを使用する場合です (より良い方法がある場合)。
何か案は?
更新しました
OK、これはうまくいきました:
List<string> intermediateList = PlatypusData.getCurrentlyVals();
intermediateList.Remove("Surrounded by purplish-blue Penguins");
comboBoxCurrently.DataSource = intermediateList;
再度更新
私はそれをLarsの方法に変更しました:
comboBoxCurrently.Items.AddRange(PlatypusData.getCurrentlyVals().ToArray());
comboBoxCurrently.Items.Remove("Surrounded by purplish-blue Penguins");
...そして、このページには、過去または未来の人類の歴史のどのページよりも多くの文字列「紫がかった青のペンギンに囲まれている」のインスタンスがあると思います。