|
-
Nov 21st, 2003, 05:51 PM
#1
Thread Starter
Frenzied Member
Ado . Net Technical Question
Hi all,
In Microsoft Mocs, they say that Data Reader is faster than DataAdapter becasue Data Reader holds one record in memory while data adapter caches all records in memory.
The question is, If i am looping thru records thru a datareader, and i am doing a kind of lenghy job. Will the table i am accessing be locked as long the reader is opened ??? In this way the data adapter will be more effecient as it will load all data once and free the table. All manipulation will be on client machine and not the server.
This question is very important as it is required to design the startegy of building my new DB Application.
-
Nov 21st, 2003, 08:26 PM
#2
Frenzied Member
Yes, but ist the DataSet and not the DataAdapter. The DataAdapter is what is use to fill the DataSet. This is what I always tell people. If you are going to be editing and updating your data, then use a DataSet. If all you want to do is just display a list of your data, use a DataReader.
-
Nov 22nd, 2003, 06:14 AM
#3
Fanatic Member
hi there,
will u pls define what is DataReader and DataSet? Also provide me some couple of sample codes. I am new to .Net
regards
Originally posted by DevGrp
Yes, but ist the DataSet and not the DataAdapter. The DataAdapter is what is use to fill the DataSet. This is what I always tell people. If you are going to be editing and updating your data, then use a DataSet. If all you want to do is just display a list of your data, use a DataReader.
-
Nov 25th, 2003, 12:14 PM
#4
Addicted Member
Yah,
DataAdapter is nothing but just a builder class which builds a dataset. When you use dataset you must consider it in mind that you are going to access the database in a disconnect maner after the results has been populated, so the concurrency will lost. If you are developing a web application then I will suggest you to write a stored procedure for the lengthy job and process it in batch. If you are going to do the task in client machine's resource and it is going to be a normal windows application then I suggest you to not to use ADO.NET inste,but you can use the older ADO to maintain the concurrency. If you don't want to maintain the concurrency then absolutely it is not going to be a problem and using dataset will be a better approach.
Jai
See you,
-Jai
[Friends Never Say Good Bye]
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
|