比较 我不在这里工作。
我要问的是:
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();