dataset_datregeatable
TRANSCRIPT
-
7/30/2019 Dataset_datregeatable
1/4
Dataset Datatable1. A dataset is a collection of datatables 1. A datatable is a collection of rows and
columns
2. The dataset has more overhead and is
*fatter (for transmission purposes)
than the datatable but this overhead allowsfor easier management and added
functionality.
2. The datatable has less overhead and is
*fatter (for transmission purposes) than the
dataset.
3. A dataset also has a higher level of
abstraction compared to a datatable or an
array list which makes it more suitable for
component development in n-tiredsituations.
3. A datatable has a lower level of
abstraction compared to a dataset.
4. A dataset represents an in-memory cacheof data consisting of any number of inter-
related datatable objects.
4. A datatable object represents a tabularblock of in-memory data.
5. A Dataset is like a mini-database engine,but its data is stored in the memory.
5. Not
Dataset DataReader 1. A Dataset works in a disconnected
environment.
1.A DataReader works in a connected
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
abstraction compared to a DataReader.
3. A DataReader has a lower level of
abstraction compared to a dataset.
4.Not 4. The DataReader class' HasRowsproperty can be called to determinewhether the DataReader retrieved any rows
from the source.
5.A Dataset uses Data Adapter 5. It is returned by the ExecuteReadermethod of the SQLCommand class,
typically as a result of a SQL Select
statement.
-
7/30/2019 Dataset_datregeatable
2/4
Repeater DataList DataGrid
Read only Read/Edit Read/Edit
Repeater control allows forcomplete and total control
of the rendered HTMLmarkup
Better performance andmore control over the
displayed data
Simple and ability to allowthe end-user to sort, page,
and edit its data
Feature Repeater DataList Gridview
Table Layout No No Yes
Flow layout Yes Yes No
Column layout No Yes No
Style properties No Yes Yes
Templates Yes Yes Columns/optional
Select/Edit/Delete No Yes YesSort No No Yes
Paging No No Yes
ViewState DataCache1. ViewState is that it can only save the valuesfor page level access.
1. DataCacheis that it can save the values forapplication level access.
2. ViewState is not completely safe. 2. DataCacheis safer than ViewState.
3. ViewState is an ideal candidate if youare planning to save small values. Mostlyvalues of server controls are saved in
ViewState.
3. If you plan to store large datasets,datatables or collections than data cachingis an excellent candidate.
4. Use too many viewstates in page leads toslow execution of page.
4. Caching enables you to store the expensivedata into Cache object and later retrieve itwithout doing expensive operations. DataCaching can tremendously increaseperformance since each time the data isrequested you can turn to the Cache objectrather than going to the database and fetchingthe result.
5. ViewState hasnt expiration and its
access till the page in use.
5. The Cache object can also have anexpiration which would allow us toreinstitute data into the memory in
intervals.6. Its not accessible to another page. 6. Its accessible through the application
life time or till expiration of cache.
7. It can store at client side only. 7. It can be stored at client/server side.
http://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspxhttp://www.codersource.net/asp_net_viewstate_versus_data_caching.aspx -
7/30/2019 Dataset_datregeatable
3/4
Stored Procedure Function1. In SPs u can use DDL, DML smts,
PL/SQL.
1. In functions u cant use DDL , DML smts
(like Insert,Delete,Update) which ispossible 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
procedure.
4. Function can accept less parameter than
procedure.
5. Stored procedures may return a scalarvalue, a table value or nothing at all.
5. Functions must always return a value(either a scalar value or a table).
6.Stored procedures are calledindependently, using the EXEC command
6. Functions are called from within anotherSQL statement.
7. Stored procedure allow you to enhance
application security by granting users and
applications permission to use storedprocedures
7.Functions cant give any security
enhancement like SPs.
8. SPs can change. 8. Functions can't change the server
environment or your operating systemenvironment.
9. T-SQL will ignore an error in a SPROCand proceed to the next statement in your
code (provided you've included error
handling support).
9. Operationally, when T-SQL encountersan error the function stops.
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 thatsame rowset in your application the better
choice would be a SPs.11. If you have an operation such as aquery 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 Arrays
1. ArrayList is a collection datatype whichtakes value/key pair. You need to use .Add
property to add values to the ArrayList
collection. You can access the ArrayListusing keys.
1. Array is a datatype which can beaccessed using indexes.
2. The ArrayList is more dynamic, you can
add and remove items without loosingperformance.
2. Arrays cannot be changed in size at
runtime (except using 'ReDim' which willcreate a new array, copy the old array in the
new array and destroy the old array).
3. ArrayList, you are dealing with a
collection. There are several types of
3. An array in .NET is actually a class
(System. Array)
-
7/30/2019 Dataset_datregeatable
4/4
collections in .NET (System. Collections
and System.Collections.Specializednamespaces)
4. An ArrayList uses an array internally. So
if you work on the basis that "a thing on athing is always slower than a thing".
4. Arrays are faster
5. ArrayList is flexible then Arrays. 5. Arrays are cleaner and more efficient but
lack flexibility.
Dataset Collection
1. A dataset is the "atom" that a user can
select. The user often makes furtherselections from within the dataset.
1. A collection is just a container for
datasets.
2. For selections within a dataset, the usercan expect more delays because the server
is actually being communicated with.
2. selections within the collection are fast(because the server does not have to be
contacted)3.Selection within a dataset is
Protocol-dependent.3. Selection within a collection isnt
protocol-dependent.