Results 1 to 4 of 4

Thread: Ado . Net Technical Question

  1. #1

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    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.

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    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.

  3. #3
    Fanatic Member pvbangera's Avatar
    Join Date
    Sep 2001
    Location
    Mumbai, India
    Posts
    961
    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.

  4. #4
    Addicted Member
    Join Date
    Nov 2003
    Location
    India
    Posts
    227
    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
  •  



Click Here to Expand Forum to Full Width