|
-
Jul 27th, 2005, 02:26 PM
#1
Thread Starter
Addicted Member
probem with sqlcedatareader
I have the datareader look into my table through an sql command and put its values into an array. it executes and read fine. i can can navigate through my records also. the problem is that I can not do a search again. it says there is a sharing violation. this is because my reader is still open. i would close it but i need to be able to navigate. is there a better option that what i am using? maybe a temporary table that it could store my filtered records that can be overwritten whenever i do a search again.
-
Jul 27th, 2005, 02:50 PM
#2
Re: probem with sqlcedatareader
For one thing, a datareader is forward-only, so you can't go through it again.
You get to decide here. If you want to move forwards, backwards, sideways, etc., a dataset is probably more appropriate. However, datasets are more versatile, and thus a slight bit slower (you may not notice this). You can certainly refresh the dataset at any time, and any changes to the underlying database will appear in the refreshed dataset.
However, you could also just close the datareader and re-create it. If you will move through it many times fairly quickly, this is probably not a good idea, but if you will only move through it every now and then, it might be easier to simply create a new datareader each time.
My usual boring signature: Nothing
 
-
Aug 2nd, 2005, 08:14 AM
#3
Thread Starter
Addicted Member
Re: probem with sqlcedatareader
i decided to move to the dataset, the problem is i do not know how to make one. please se my other post. "dataset"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|