Skip to main content

Difference between DataAdapter and DataReader

What is the difference between DataAdapter and DataReader?

DataAdapter-

  • Disconnected Architecture.
  • The time we call the data adapter, all the records are filled in the memory and we will be able to fetch the records even after the database connection is closed.

DataReader-

  • Connected Architecture.
  • DataReader always need live database connection to fetch records from database.

Comments

Popular posts from this blog

What is the difference between var and dynamic keywords? var is early binded dynamic is late binded . In order to understand the concept of early binding and late binding, let us check the below program- In the above program, we are using var keyword to assign string type of value to a variable. Since the variable is of type string, hence while trying to print the length of the string on console, we have to use Length property. When we try to do so, after typing a dot(.) after the variable "name", all the properties associated with the string variable are easily accessible along with the length property. Now, in all the above process where is early binding explained? Notice, the Length property of the string starts with  capital "L"  letter. If we try to use  small "l" , then the compiler will immediately show the error red line indicating that there is no property "length" that starts with small "l" for a  ...

Boxing and Unboxing in C#

What is  Boxing and Unboxing in .Net? Boxing- Conversion of value types to reference types. E.g.-                int i=1;                         object obj= i; Unboxing- Conversion of reference types to value types. E.g.-               int j= (int) obj; Basically we should avoid boxing and unboxing in practical implementation as it degrades the performance.