
Signature
Share The Knowledge. I need all the help I can get and so do you!
> I wouldn't recommend it. If you hold a data reader and don't close it,
> then the connection associated with it is held open. The thing with a data
[quoted text clipped - 16 lines]
> > would need to be refreshed a few times during the day as information
> > changes.
You could possibly store a SqlDataAdapter as a static instance, however,
if you are pounding on it from multiple threads, then you are going to have
to synchronize access, and you are probably going to lose any performance
benefit that you gain. Also, you would have to pass the connection to your
method which uses the data adapter, and set the connection on the commands
attached to it, as you can't leave those open and on the command.
All in all, you are better off creating the connection, creating your
adapters, using it, and then disposing of it properly.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> thanks for responding,
> My mistake reader was the wrong item to suggest better would be an adaptor
[quoted text clipped - 36 lines]
>> > would need to be refreshed a few times during the day as information
>> > changes.
Yankee Imperialist Dog - 14 Sep 2007 16:54 GMT
thank you,
Well, i had an idea, a good one but there are better ways to do this. I
really appreciate your advise and I'll follow it.
I do what i'm suggesting all the time in ColdFusion, only problem is it can
NOT be done with sp's must use ad hoc queries. Can you or anyone else
recomend a good way to cache a result set for the use i'm suggesting?

Signature
Share The Knowledge. I need all the help I can get and so do you!
> You could possibly store a SqlDataAdapter as a static instance, however,
> if you are pounding on it from multiple threads, then you are going to have
[quoted text clipped - 46 lines]
> >> > would need to be refreshed a few times during the day as information
> >> > changes.
Nicholas Paldino [.NET/C# MVP] - 14 Sep 2007 17:32 GMT
Why not store the results in a DataSet/DataTable and then access that?

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> thank you,
> Well, i had an idea, a good one but there are better ways to do this. I
[quoted text clipped - 67 lines]
>> >> > would need to be refreshed a few times during the day as information
>> >> > changes.