Negative Value Condition
////////
var results = (from row in tb1.AsEnumerable()
where row.Field<double>("ColumnNameHere").<0)
select row).Count();
OR var results = (from row in DataSetInstance.Table[0].AsEnumerable()
where row.Field<double>("Order_num").ToString().Contains("-")
select row).Count();
if( results == 0 )
{
// Do the processing
}
else
{
//Negative value not allow.
}
/////////
////////
var results = (from row in tb1.AsEnumerable()
where row.Field<double>("ColumnNameHere").<0)
select row).Count();
OR var results = (from row in DataSetInstance.Table[0].AsEnumerable()
where row.Field<double>("Order_num").ToString().Contains("-")
select row).Count();
if( results == 0 )
{
// Do the processing
}
else
{
//Negative value not allow.
}
/////////
No comments:
Post a Comment