CompareTo はここでは機能しません。
私のlinqクエリは
var result = from c in customers
where c.CustomerID.CompareTo(txtSerchId.Text) >= 0
select` c;
そして例外が発生します
//////例外///////////
System.ArgumentException was caught
Message=Value does not fall within the expected range.
私のコードはこのようなものです
var result =
from c in customers
where c.CustomerID.CompareTo(txtSerchId.Text) >= 0
select c;
if (result != null)
{
IEnumerator<Customer> resultEnum = result.GetEnumerator();
while (resultEnum.MoveNext())
{
Customer c = (Customer)resultEnum.Current;
addToDataSet(Guid.NewGuid().ToString(), c);
}
ShowResult();
}
else
{
MessageBox.Show("No Customer found within criteria");
}
例外はこの行にあります
IEnumerator<Customer> resultEnum = result.GetEnumerator();