preferred syntax for datareader?

  • Thread starter Thread starter Paul W
  • Start date Start date
P

Paul W

Hi - what's best:

ResourceName = CType(dtr("ResourcePoolName"), String)
or
ResourceName = dtr("ResourcePoolName").ToString
or
ResourceName = dtr.GetString(dtr.GetOrdinal("ResourcePoolName"))
or ....?
I guess my main criteria is runtime performance. I don't want to use
dtr.getString(0) in case the field orders change.

Thanks,
Paul.
 
Hi Paul,

I would use 3rd option with a slight modification - store the ordinal value
before going into loop and then use the stored value.
 

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