Evaluating a condition in a string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I have a scenario as below.

I have a data row like

AcctNum CheckNum Amt Payee Date
9999999 125699 10370.25 ABCD...XYZ 04/24/06

Now I have to process this row basing on a condition.

if (<Condition>)
//Process The row
else
continue;

The complexity here is, <Condition> comes from a configuration file, like
length of payee > 40 (_dataRow["Payee"].ToString().Length > 40) and Amt >
50000.00 etc...
But this expression comes as a string which i have to evalute to true or
false.

This condition varies from bank to bank and will be maintained in a config
file.

Is there any way to achieve this? Or is there any different approach to
solve this?

Thanks in advance
 
Hi,

Looks to me like you'll could try using DataTable.Select statement using a
valid expression (see DataColumn.Expression).
 
Thanks a lot, got the pointer..


--
Satya


Miha Markic said:
Hi,

Looks to me like you'll could try using DataTable.Select statement using a
valid expression (see DataColumn.Expression).

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Satya said:
Hi All,

I have a scenario as below.

I have a data row like

AcctNum CheckNum Amt Payee Date
9999999 125699 10370.25 ABCD...XYZ 04/24/06

Now I have to process this row basing on a condition.

if (<Condition>)
//Process The row
else
continue;

The complexity here is, <Condition> comes from a configuration file, like
length of payee > 40 (_dataRow["Payee"].ToString().Length > 40) and Amt >
50000.00 etc...
But this expression comes as a string which i have to evalute to true or
false.

This condition varies from bank to bank and will be maintained in a config
file.

Is there any way to achieve this? Or is there any different approach to
solve this?

Thanks in advance
 
Back
Top