ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

Which one is better to use in ADO.Net C#, data set or datareader?

user-image
تم إضافة السؤال من قبل MohammadSalman Abbasi , Project Co-ordinator , AMC (Ahmedabad Municipal Corporation)
تاريخ النشر: 2014/07/08
Zafar Ali Khan
من قبل Zafar Ali Khan , software engineer , White Wings Technologies

It depends on your needs. If you want to do readonly fast reading then use DataReader. And if you want to load data from multiple Tables. and you want to store it in single place. And you want to work with data after disconnectivity then Dataset is good.

DataSet is actually the collection of DataTables, DataRelations and you can load Data from Xml source also.

Santosh kumar mada
من قبل Santosh kumar mada , Software developer , Thrinaina informatics pvt Ltd

that depends on the data you want from the database...you can go for data reader if you want a single record.....and if you want multiple records than you can go for dataset.. bcoz we can directly bind that to a data source..but when you use data reader for multiple records we cannot directly bind those records to an datasource. and for -loop is used to bind those records which is time consuming and repetetive 

Mostafa ElFadaly
من قبل Mostafa ElFadaly , Junior Software Developer , LADIS

DataReader If you  want to edit and add into retrieving data

Rameez Ahmed Sayad
من قبل Rameez Ahmed Sayad , .Net Consultant , Proximus Luxembourg

If it's about retrieving the rows then use DataReader faster than DataAdapter.

DataReader is a connected model whereas Dataset is a disconnected , 

you can use DataReader to write to your DataSet through DataRow and DataTable

The difference being DataAdapter behind the scenes creates all the schema and directly adds rows to it . 

For DataReader , You will have to manually create the DataTable , then define the DataColumn, then create NewRow() and assign row by row through DataReader.

المزيد من الأسئلة المماثلة

هل تحتاج لمساعدة في كتابة سيرة ذاتية تحتوي على الكلمات الدلالية التي يبحث عنها أصحاب العمل؟