Thanks Jon. I will change the code to utilize the DbNull check as you
after the first row passes. I think I can provide you with the structure of
data. The thing is though if you'll SQL server as oppose to Oracle (which is
my source) the results might be different and will not help me at all. But
execute returns data real fast. I'll try to see what's taking so long in
and then determine what's wrong with them. Any further code analysis and
"Jon Skeet [C# MVP]" wrote:
> Alex <Alex@discussions.microsoft.com> wrote:
> > First of all thanks for fast replies all. I'm pretty sure that the view does
> > not take long to be executed. Each row has no more than 60 columns.
>
> Hmm. It would certainly be worth timing how long it would take to load
> all the data into a dataset just using DataAdapter.Fill. As you say,
> this *shouldn't* take a long time, but it would be good to rule it out.
>
> > not sure how I can use the dr.IsDbNull since dr referes to
> > datareader, and I"m checking if the value of a particular
> > column/field is dbNull.
>
> Because DataReader.IsDBNull takes a parameter which specifies which
> column to check for nullity.
>
> > I thought about only doing the XPath call for the first row and storing in
> > some form of array/collection. Will see if this helps the performance.
>
> Righto.
>
> > Another idea I had, but not 100% sure how to implement is to load the data
> > from view in DataSet and create an XSLT file that does the logic/formating
> > and outputing the file to HD. Once data loaded in Dataset it's essentially
> > XML so it might be possible to apply the XSLT file to it to achieve the
> > desired result faster.
>
> I suspect that wouldn't help - that would involve a lot more processing
> than you *should* be incurring here.
>
> > Any pointers/examples of code in this directions would
> > be appreciated too. At this point I'm still stuck as to why it's so
> > incredibly slow. I've tried going through 1 loop of all fiels and the
> > processing seemed to work correctly without any sidetracking or delays.
> > Thanks again for your help!
>
> If you're able to provide a sample database somehow, I'd be happy to
> look at it all more closely and try to tweak it. (I'd probably change
> the code to C# just to make it easier for me to analyze, but it should
> be easy to apply anything learned there back to the VB.NET.)
>
> Something else you might like to do just to make the code nicer is to
> use OleDbDataReader.GetString rather than casting the result of
> GetValue to String. I'd be very surprised if that made things faster,
> but it would certainly be cleaner code. Unless, of course, that CType
> is doing more than a cast would in C# - if it's actually doing
> conversions from numbers etc, GetString would fail.
>
> --
> Jon Skeet - <skeet@pobox.com>
>
http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too