I’m using a select method on a dataset to retreive the results that match my condition:
foreach (DataRow dr in dsPone2.Tables["tt-pone"].Select(strWhereCondition))
{
dsPone.Tables["tt-pone"].ImportRow(dr);
}
How do I change the strWhereCondition from
strWhereCondition += " AND poneid = 0 and aoneid = 0 and tranid = 0";
To where tranid is NOT 0?
Do I use <> or !=?
As is so often the case, consulting the documentation is the way forward.
DataTable.Select(string)redirects toDataColumn.Expressionto document what’s allowed in a filter expression – and the “Operators” list shows<>but not!=.Personally I would try to avoid string-based filtering and use LINQ to DataSet instead, but of course that requires .NET 3.5 or higher.