Expression - IFF - Performance problem

G

Guest

Hi,

I'm trying to use the "Expression" property to convert a column of IDs into
Strings. ( i.e. IIF(INFO_ID = 0, '" + strOption1 + "', IIF(INFO_ID = 1, '" +
strOption2 + "' ... )

However, I've noticed that the more IFFs I add the worse the performance of
my DataGrid gets. I've edited my Expression and the contents of my DB so
that I always match on the first IFF in my expression, but this doesnt seem
to have any effect on improving performance.

The performance different is significant, with 2 IFFs in my expression I am
loading 5000 rows in about 1 sec. With 11 IFFs in my expression it takes 35
seconds!!

Is there a solution to this ?? The only thing I can think of is to use a
JOIN in my SQL query and have a string lookup table in my DB, but I really
really dont want to do this as it will be a headache to manage.

RichS
 
G

Guest

You guys are too slow ;-)

I solved my problem. I re-wrote my code so that now I create in-memory
tables with the ID->Names and then use DataRelation to map the columns.
Performance is back and code is only slightly more complicated.

RichS
 

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

Top