IDataReader and ExecuteDataSet

Mar 16, 2010 at 10:54 AM

I am using EntLib for my C# application.

Im my Data Access Layer, I made like that :

Database dtBase = DatbaseFactory.CreateDatabase();
using (DbCommand com = dtBase.GetSqlStringCommand("select * from customer"))
{
     using (IDataReader = dtBase.ExecuteReader(com))
     {
          // code
     }
}

But, is it faster using dtBase.ExecuteDataSet() ?

Which is the fastest between ExecuteReader and ExecuteDataSet ?

Thank you !

 

Mar 17, 2010 at 5:54 AM

Hi Sancha,

I think it still depends, since performance should always be weight by considering all factors within the application.  

Though, if in terms of we're just only comparing the two without any other things to consider, from a nutshell ExecuteReader is faster than ExecuteDataSet. This article (http://articles.techrepublic.com.com/5100-10878_11-5054665.html) may give you more insight.   

HTH,

~ginkapitan