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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top