Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 4

Dataset

1. A dataset is a collection of datatables

Datatable

1. A datatable is a collection of rows and columns 2. The dataset has more overhead and is 2. The datatable has less overhead and is *fatter (for transmission purposes) *fatter (for transmission purposes) than the than the datatable but this overhead allows dataset. for easier management and added functionality. 3. A dataset also has a higher level of 3. A datatable has a lower level of abstraction compared to a datatable or an abstraction compared to a dataset. array list which makes it more suitable for component development in n-tired situations. 4. A dataset represents an in-memory cache 4. A datatable object represents a tabular of data consisting of any number of inter- block of in-memory data. related datatable objects. 5. A Dataset is like a mini-database engine, 5. Not but its data is stored in the memory.

Dataset

DataReader

1. A Dataset works in a disconnected 1.A DataReader works in a connected environment. environment 2. A Dataset can be read/edit. 2. A DataReader object represents a forward only, read only access to data from a source. 3. A Dataset also has a higher level of 3. A DataReader has a lower level of abstraction compared to a DataReader. abstraction compared to a dataset. 4.Not 4. The DataReader class' HasRows property can be called to determine whether the DataReader retrieved any rows from the source. 5.A Dataset uses Data Adapter 5. It is returned by the ExecuteReader method of the SQLCommand class, typically as a result of a SQL Select statement.

DataList Read/Edit Better performance and Repeater control allows for more control over the complete and total control displayed data of the rendered HTML markup

Repeater Read only

DataGrid Read/Edit Simple and ability to allow the end-user to sort, page, and edit its data

Feature Table Layout Flow layout Column layout Style properties Templates Select/Edit/Delete Sort Paging

Repeater No Yes No No Yes No No No

DataList No Yes Yes Yes Yes Yes No No

Gridview Yes No No Yes Columns/optional Yes Yes Yes

ViewState
for page level access. 2. ViewState is not completely safe.

DataCache
application level access. 2. DataCache is safer than ViewState.

1. ViewState is that it can only save the values 1. DataCache is that it can save the values for 3. ViewState is an ideal candidate if you 3. If you plan to store large datasets,
are planning to save small values. Mostly values of server controls are saved in ViewState. datatables or collections than data caching is an excellent candidate.

4. Use too many viewstates in page leads to 4. Caching enables you to store the expensive data into Cache object and later retrieve it slow execution of page.

without doing expensive operations. Data Caching can tremendously increase performance since each time the data is requested you can turn to the Cache object rather than going to the database and fetching the result.

5. ViewState hasnt expiration and its 5. The Cache object can also have an expiration which would allow us to access till the page in use.
reinstitute intervals. data into the memory in

6. Its not accessible to another page. 7. It can store at client side only.

6. Its accessible through the application life time or till expiration of cache. 7. It can be stored at client/server side.

Stored Procedure

Function

1. In SPs u can use DDL, DML smts, 1. In functions u cant use DDL , DML smts PL/SQL. (like Insert,Delete,Update) which is possible in SPs. 2. Sp can return multiple resultset. 2. Function can return only one resultset. 3. SP can return XML output. 3. Function can not return XML output. 4.SP can accept more parameter than 4. Function can accept less parameter than procedure. procedure. 5. Stored procedures may return a scalar 5. Functions must always return a value value, a table value or nothing at all. (either a scalar value or a table). 6.Stored procedures are called 6. Functions are called from within another independently, using the EXEC command SQL statement. 7. Stored procedure allow you to enhance 7.Functions cant give any security application security by granting users and enhancement like SPs. applications permission to use stored procedures 8. SPs can change. 8. Functions can't change the server environment or your operating system environment. 9. T-SQL will ignore an error in a SPROC 9. Operationally, when T-SQL encounters and proceed to the next statement in your an error the function stops. code (provided you've included error handling support). 10. A SPROC can be used in an XML FOR clause, a UDF cannot be. 10. A UDF cannot be. 11. However, when you want to use that same rowset in your application the better 11. If you have an operation such as a choice would be a SPs. query with a FROM clause that requires a rowset be drawn from a table or set of tables, then a function will be your appropriate choice. ArrayList 1. ArrayList is a collection datatype which takes value/key pair. You need to use .Add property to add values to the ArrayList collection. You can access the ArrayList using keys. 2. The ArrayList is more dynamic, you can add and remove items without loosing performance. 3. ArrayList, you are dealing with a collection. There are several types of Arrays 1. Array is a datatype which can be accessed using indexes.

2. Arrays cannot be changed in size at runtime (except using 'ReDim' which will create a new array, copy the old array in the new array and destroy the old array). 3. An array in .NET is actually a class (System. Array)

collections in .NET (System. Collections and System.Collections.Specialized namespaces) 4. An ArrayList uses an array internally. So 4. Arrays are faster if you work on the basis that "a thing on a thing is always slower than a thing". 5. ArrayList is flexible then Arrays. 5. Arrays are cleaner and more efficient but lack flexibility. Dataset 1. A dataset is the "atom" that a user can select. The user often makes further selections from within the dataset. 2. For selections within a dataset, the user can expect more delays because the server is actually being communicated with.
3.Selection within a dataset is

Collection 1. A collection is just a container for datasets. 2. selections within the collection are fast (because the server does not have to be contacted) 3. Selection within a collection isnt protocol-dependent.

Protocol-dependent.

You might also like