Tuesday 9 April 2013

Dotnet Difference

ADO.NET Difference: 

http://onlydifferencefaqs.blogspot.in/2012/08/aspnet-difference-between-questions.html 

  1. What are the differences between DataReader and DataAdapter?

S.No DataReader DataAdapter
1 Works in Connected Mode Works in Disconnected Mode
2 Can have only one record at a time Can have more than 1 records
3 Is ForwardOnly and Readonly Can navigate front and back and editable
4 Faster Slower
  1. What are the differences between DataSet and DataReader?

S.No DataSet DataReader
1 The data store whose records have to be manipulated can be disconnected. You can read data from datareader only if the connection to data store exists.
2 You have the provision to cache data fetched from data store when using dataset. Caching of data is not possible.
3 Dataset objects have XML Support. XML Support is not provided by datareader.
4 A single dataset object can contain collection of datatable objects wherein each datatable object refers to a table in the datastore. Hence you can manipulate on multiple tables using a dataset. Datareader can read records fetched by a command object containing a single query. If you have to fetch data from multiple tables, then datareader is not advantageous when compared to dataset.
5 Using dataset, you can read the records fetched in any order. While reading records, you can iterate only in forward direction.
6 Performance wise, dataset is slow because it has multiple tables which in turn include multiple rows, columns and constraints. Datareader gives high performance and records can be fetched faster when compared to dataset.
  1. What is the difference between DataSet.Copy() and DataSet.Clone()?

S.No DataSet.Copy() DataSet.Clone()
1 DataSet.Copy() copies both the structure and data DataSet.Clone() copies the structure of the DataSet, including all DataTable schemas, relations, and constraints and it does not copy any data
  1. What are the differences between RecordSet and DataSet?

S.No RecordSet DataSet
1 RecordSet provides data of one row at an instant DataSet is a data structure which represents the complete table data at the same time
2 RecordSet always needs an Open connection to read the data from data sources DataSet needs connection only for retrieving the data. After retrieve the data connection is not necessary
3 RecordSet is able to load the structure and data of only one table at a time DataSet has the capability to store the structure and data of multiple tables at a time
4 RecordSet does not support constraints of Databases DataSet enforces data integrity by using Constraints
  1. What are the differences between ADO and ADO.Net?

S.No ADO ADO.Net
1 It is a COM based library. It is a CLR based library.
2 Classic ADO requires active connection with the data store. ADO.NET architecture works while the data store is disconnected.
3 Locking feature is available. Locking feature is not available.
4 Data is stored in binary format. Data is stored in XML.
5 XML integration is not possible. XML integration is possible.
6 It uses the object named Recordset to reference data from the data store. It uses Dataset Object for data access and representation.
7 Using Classic ADO, you can obtain information from one table or set of tables through join. You cannot fetch records from multiple tables independently. Dataset object of ADO.NET includes collection of DataTables wherein each DataTable will contain records fetched from a particular table. Hence multiple table records are maintained independently.
8 Firewall might prevent execution of Classic ADO. ADO.NET has firewall proof and its execution will never be interrupted.
9 Classic ADO architecture includes client side cursor and server side cursor. ADO.NET architecture doesn't include such cursors.
10 You cannot send multiple transactions using a single connection instance. You can send multiple transactions using a single connection instance.

     6.Difference between Typed DataSet and Untyped DataSet

S.No
Typed DataSet
Untyped DataSet
1
It provides additional methods, properties and events and thus it makes it easier to use.
It is not as easy to use as strongly typed dataset.
2
They have .xsd file (Xml Schema definition) file associated with them and do error checking regarding their schema at design time using the .xsd definitions.
They do not do error checking at the design time as they are filled at run time when the code executes.

3
We will get advantage of intelliSense in VS. NET.
We cannot get an advantage of intelliSense.
4
Performance is slower in case of strongly typed dataset.
Performance is faster in case of Untyped dataset.
5
In complex environment, strongly typed dataset's are difficult to administer.
Untyped datasets are easy to administer.

        Typed DataSets use explicit names and DataTypes for their members.
        ex:
        northwindDataSet.Products.ProductNameColumn.Caption = "pnames";


       UnTyped DataSets use table and column collections for their members
      ex:
      ds.Tables["emp"].Columns["eno"].ReadOnly=true;



    7.Difference between DataView and DataTable


S.No
DataView
DataTable
1
Read-only i.e., DataView can be used to select the data.
Read/Write i.e., Datatable can be used to edit or select or delete or insert a data.
2
Is a reference to an existing DataTable. Cannot be populated from scratch; must be instantiated with a reference to an existing DataTable.
Can be created empty and then populated
3
Data is a reference to an existing DataTable, and does not consume space.
Data takes storage space.
4
Can sort or filter rows without modifying the underlying data. Rows and columns can be hidden and revealed repeatedly.
Can add/edit/delete rows, columns, and data, and all changes are persistent.
5
Can return a DataTable version of the view
Can be cloned
6
A live reference to a DataTable; any changes in the DataTable data is immediately reflected in the view.
Is source data; does not contain references
7
Supports calculated columns, which are columns with a value calculated on the fly by combining or manipulating other columns.
Does not support calculated columns
8
Can hide or show selected columns
No row or column hiding

  8.Difference between Connected and Disconnected Environment


S.No
Connected Environment
Disconnected Environment
1
Connected Environment needs a constantly connection of user to data source while performing any operation.
Disconnected Environment does not need any connection.
2
Only one operation can be performed at a time in connection Environment.
Multiple operations can be performed.
3
DataReader is used in Connection Environment.
DataSet is used in it.
4
It is slower in speed.
Disconnected Environment has a good speed.
5
We get updated data in it.
There is a problem of dirty read.