SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Downloaden Sie, um offline zu lesen
ADO.NET Difference FAQs-1
   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     Can have more than 1 records
            time

     3      Is ForwardOnly and Readonly       Can navigate front and back and
                                              editable

     4      Faster                            Slower
   2. What are the differences between DataSet and DataReader?

     S.No   DataSet                           DataReader

     1      The data store whose records      You can read data from datareader
            have to be manipulated can be     only if the connection to data store
            disconnected.                     exists.

     2      You have the provision to cache   Caching of data is not possible.
            data fetched from data store
            when using dataset.

     3      Dataset objects have XML          XML Support is not provided by
            Support.                          datareader.

     4      A single dataset object can       Datareader can read records
            contain collection of datatable   fetched by a command object
            objects wherein each datatable    containing a single query. If you
            object refers to a table in the   have to fetch data from multiple
            datastore. Hence you can          tables, then datareader is not
            manipulate on multiple tables     advantageous when compared to
            using a dataset.                  dataset.

     5      Using dataset, you can read the   While reading records, you can
            records fetched in any order.     iterate only in forward direction.

     6      Performance wise, dataset is      Datareader gives high performance
            slow because it has multiple      and records can be fetched faster
            tables which in turn include      when compared to dataset.
            multiple rows, columns and
            constraints.
   3. What is the difference between DataSet.Copy() and DataSet.Clone()?

     S.No   DataSet.Copy()                    DataSet.Clone()

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

  S.No   RecordSet                            DataSet

  1      RecordSet provides data of one       DataSet is a data structure which
         row at an instant                    represents the complete table data
                                              at the same time

  2      RecordSet always needs an            DataSet needs connection only for
         Open connection to read the          retrieving the data. After retrieve the
         data from data sources               data connection is not necessary

  3      RecordSet is able to load the        DataSet has the capability to store
         structure and data of only one       the structure and data of multiple
         table at a time                      tables at a time

  4      RecordSet does not support           DataSet enforces data integrity by
         constraints of Databases             using Constraints
5. 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           ADO.NET architecture works while the
         connection with the data store.       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              It uses Dataset Object for data access
         Recordset to reference data from      and representation.
         the data store.

  7      Using Classic ADO, you can            Dataset object of ADO.NET includes
         obtain information from one table     collection of DataTables wherein each
         or set of tables through join. You    DataTable will contain records fetched
         cannot fetch records from multiple    from a particular table. Hence multiple
         tables independently.                 table records are maintained
                                               independently.

  8      Firewall might prevent execution      ADO.NET has firewall proof and its
         of Classic ADO.                       execution will never be interrupted.

  9      Classic ADO architecture includes     ADO.NET architecture doesn't include
         client side cursor and server side    such cursors.
         cursor.
10     You cannot send multiple             You can send multiple transactions
             transactions using a single          using a single connection instance.
             connection instance.


Reference: http://onlydifferencefaqs.blogspot.in/2012/07/adonet-difference-faqs-1.html


ADO.Net Difference FAQs-2
1.Difference between Typed DataSet and Untyped DataSet

      S.No   Typed DataSet                     Untyped DataSet

      1      It provides additional methods,   It is not as easy to use as strongly
             properties and events and thus    typed dataset.
             it makes it easier to use.

      2      They have .xsd file (Xml          They do not do error checking at
             Schema definition) file           the design time as they are filled at
             associated with them and do       run time when the code executes.
             error checking regarding their
             schema at design time using
             the .xsd definitions.

      3      We will get advantage of          We cannot get an advantage of
             intelliSense in VS. NET.          intelliSense.

      4      Performance is slower in case     Performance is faster in case of
             of strongly typed dataset.        Untyped dataset.

      5      In complex environment,           Untyped datasets are easy to
             strongly typed dataset's are      administer.
             difficult 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;

2.Difference between DataView and DataTable


      S.No   DataView                          DataTable

      1      Read-only i.e., DataView can      Read/Write i.e., Datatable can be
             be used to select the data.       used to edit or select or delete or
                                               insert a data.
2      Is a reference to an existing     Can be created empty and then
            DataTable. Cannot be              populated
            populated from scratch; must
            be instantiated with a
            reference to an existing
            DataTable.

     3      Data is a reference to an         Data takes storage space.
            existing DataTable, and does
            not consume space.

     4      Can sort or filter rows without   Can add/edit/delete rows, columns,
            modifying the underlying data.    and data, and all changes are
            Rows and columns can be           persistent.
            hidden and revealed
            repeatedly.

     5      Can return a DataTable version Can be cloned
            of the view

     6      A live reference to a             Is source data; does not contain
            DataTable; any changes in the     references
            DataTable data is immediately
            reflected in the view.

     7      Supports calculated columns,   Does not support calculated
            which are columns with a value columns
            calculated on the fly by
            combining or manipulating
            other columns.

     8      Can hide or show selected         No row or column hiding
            columns

3.Difference between Connected and Disconnected Environment


     S.No   Connected Environment             Disconnected Environment

     1      Connected Environment needs Disconnected Environment does
            a constantly connection of user not need any connection.
            to data source while
            performing any operation.

     2      Only one operation can be         Multiple operations can be
            performed at a time in            performed.
            connection Environment.

     3      DataReader is used in             DataSet is used in it.
            Connection Environment.

     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.

Reference: http://onlydifferencefaqs.blogspot.in/2012/08/adonet-difference-faqs-2.html


ADO.NET Difference FAQs-3
1.Difference between ExecuteNonQuery() and ExecuteScalar() methods in ADO.NET

      S.No   ExecuteNonQuery()                ExecuteScalar()

      1      It will work with Action Queries It will work with Non-Action Queries
             only                             that contain aggregate functions.
             (Create,Alter,Drop,Insert,Updat
             e,Delete).

      2      It returns the count of rows It returns the first row and first
             effected by the Query.       column value of the query result.

      3      Return type is int               Return type is object.

      4      Return value is optional and Return value is compulsory and
             can be assigned to an integer should be assigned to a variable of
             variable.                     required type.

Example-1 for ExecuteNonQuery Method -Insert:

SqlCommand cmd = new SqlCommand("Insert Into SampleTable Values('1','2')",con);
//con is the connection object

con.Open();
cmd.ExecuteNonQuery(); //The SQL Insert Statement gets executed

Example-2 for ExecuteNonQuery Method - Update:

public void UpdateEmployeeEmail()
{
SqlConnection conn = new SqlConnection(connString))
String sqlQuery = "UPDATE Employee SET empemail='umar.ali@xyz.com' WHERE
empid=5;
SqlCommand cmd = new SqlCommand(sqlQuery, conn);
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
conn.Close();
}
return count;
}


Example-1 for ExecuteScalar Method:

This returns only one value that is first column value of the first row in the executed query

public int getSomeProdId()
{
int count=0;
SqlConnection conn = new SqlConnection(connString))
String sqlQuery = "SELECT COUNT(*) FROM dbo.region";
SqlCommand cmd = new SqlCommand(sqlQuery, conn);
try
{
conn.Open();
//Since return type is System.Object, a typecast is must
count = (Int32)cmd.ExecuteScalar();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
conn.Close();
}
return count;
}


Example-2 for ExecuteScalar Method:

This returns one value only, no recordsets.

cmd.CommandText = "Select Name, DOB, from Emp where ID=1";
Dim strName As string = cmd.ExecuteScalar.ToString


2.Difference between ExecuteNonQuery() and ExecuteReader() methods in
ADO.NET

      S.No      ExecuteNonQuery()                ExecuteReader()

      1         It will work with Action Queries It will work with Action and Non-
                only                             Action Queries (Select)
                (Create,Alter,Drop,Insert,Updat
                e,Delete).
2      It returns the count of rows It returns the collection of rows
             effected by the Query.       selected by the Query.

      3      Return type is int                Return type is DataReader.

      4      Return value is optional and Return value is compulsory and
             can be assigned to an integer should be assigned to an another
             variable.                     object DataReader.

Example-1 for ExecuteNonQuery Method -Insert:

SqlCommand cmd = new SqlCommand("Insert Into SampleTable Values('1','2')",con);
//con is the connection object

con.Open();
cmd.ExecuteNonQuery(); //The SQL Insert Statement gets executed

Example-2 for ExecuteNonQuery Method - Update:

public void UpdateEmployeeEmail()
{
SqlConnection conn = new SqlConnection(connString))
String sqlQuery = "UPDATE Employee SET empemail='umar.ali@xyz.com' WHERE
empid=5;
SqlCommand cmd = new SqlCommand(sqlQuery, conn);
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
finally
{
conn.Close();
}
return count;
}

Example for ExecuteReader Method:

Here, ExecuteReader is used to get set of records by specified query, namely, "select *
from emp"

SqlConnection con = new SqlConnection(constr); //constructor can be connection of string.
SqlCommand cmd = new SqlCommand ("select * from emp", con);
con.Open();
SqlDataReader dr = cmd. ExecuteReader (CommandBehavior. CloseConnection);
//Implicitly closes the connection because CommandBehavior. CloseConnection was
specified.
while(dr.Read())
{
Console.WriteLine (dr.GetString(0));
}
dr.Close();

Reference: http://onlydifferencefaqs.blogspot.in/2012/08/adonet-difference-faqs-3.html

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Relational database
Relational database Relational database
Relational database
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
DML Commands
DML CommandsDML Commands
DML Commands
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
 
Database Objects
Database ObjectsDatabase Objects
Database Objects
 
Python strings presentation
Python strings presentationPython strings presentation
Python strings presentation
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
Ado.Net Tutorial
Ado.Net TutorialAdo.Net Tutorial
Ado.Net Tutorial
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Pandas csv
Pandas csvPandas csv
Pandas csv
 
Schedule in DBMS
Schedule in DBMSSchedule in DBMS
Schedule in DBMS
 
Java ArrayList Tutorial | Edureka
Java ArrayList Tutorial | EdurekaJava ArrayList Tutorial | Edureka
Java ArrayList Tutorial | Edureka
 
Cost estimation for Query Optimization
Cost estimation for Query OptimizationCost estimation for Query Optimization
Cost estimation for Query Optimization
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 
Session and state management
Session and state managementSession and state management
Session and state management
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 
Python tuple
Python   tuplePython   tuple
Python tuple
 
Codd's rules
Codd's rulesCodd's rules
Codd's rules
 
Sets in python
Sets in pythonSets in python
Sets in python
 
Database Triggers
Database TriggersDatabase Triggers
Database Triggers
 

Ă„hnlich wie ADO.NET difference faqs compiled- 1

Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated) Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated) Umar Ali
 
Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Umar Ali
 
ADO.NET Difference FAQs-1
ADO.NET Difference FAQs-1ADO.NET Difference FAQs-1
ADO.NET Difference FAQs-1Umar Ali
 
Interview questions(programming)
Interview questions(programming)Interview questions(programming)
Interview questions(programming)sunilbhaisora1
 
Sql server difference faqs- 5
Sql server difference faqs-  5Sql server difference faqs-  5
Sql server difference faqs- 5Umar Ali
 
Asp.net interview questions
Asp.net interview questionsAsp.net interview questions
Asp.net interview questionsAkhil Mittal
 
All .net Interview questions
All .net Interview questionsAll .net Interview questions
All .net Interview questionsAsad Masood Qazi
 
What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdfAlbert828253
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworksLuis Goldster
 
Ebook5
Ebook5Ebook5
Ebook5kaashiv1
 
Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5kaashiv1
 
Discover Database
Discover DatabaseDiscover Database
Discover DatabaseWayne Weixin
 
LECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxLECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxAOmaAli
 
Ado.net session07
Ado.net session07Ado.net session07
Ado.net session07Niit Care
 
Is2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introIs2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introdannygriff1
 

Ă„hnlich wie ADO.NET difference faqs compiled- 1 (20)

Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated) Dotnet difference questions & answers Compiled-1(updated)
Dotnet difference questions & answers Compiled-1(updated)
 
Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)Dotnet difference questions and answers compiled- 1(updated-2)
Dotnet difference questions and answers compiled- 1(updated-2)
 
ADO.NET Difference FAQs-1
ADO.NET Difference FAQs-1ADO.NET Difference FAQs-1
ADO.NET Difference FAQs-1
 
ado.net
ado.netado.net
ado.net
 
Interview questions(programming)
Interview questions(programming)Interview questions(programming)
Interview questions(programming)
 
Ado.net
Ado.netAdo.net
Ado.net
 
ADO.NET
ADO.NETADO.NET
ADO.NET
 
Sql server difference faqs- 5
Sql server difference faqs-  5Sql server difference faqs-  5
Sql server difference faqs- 5
 
Asp.net interview questions
Asp.net interview questionsAsp.net interview questions
Asp.net interview questions
 
All .net Interview questions
All .net Interview questionsAll .net Interview questions
All .net Interview questions
 
What is ado .net architecture_.pdf
What is ado .net architecture_.pdfWhat is ado .net architecture_.pdf
What is ado .net architecture_.pdf
 
Ado
AdoAdo
Ado
 
Ado.net & data persistence frameworks
Ado.net & data persistence frameworksAdo.net & data persistence frameworks
Ado.net & data persistence frameworks
 
Ebook5
Ebook5Ebook5
Ebook5
 
Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5
 
Ado.net
Ado.netAdo.net
Ado.net
 
Discover Database
Discover DatabaseDiscover Database
Discover Database
 
LECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptxLECTURE 14 Data Access.pptx
LECTURE 14 Data Access.pptx
 
Ado.net session07
Ado.net session07Ado.net session07
Ado.net session07
 
Is2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_introIs2215 lecture7 lecturer_ado_intro
Is2215 lecture7 lecturer_ado_intro
 

Mehr von Umar Ali

Difference between wcf and asp.net web api
Difference between wcf and asp.net web apiDifference between wcf and asp.net web api
Difference between wcf and asp.net web apiUmar Ali
 
Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Umar Ali
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Umar Ali
 
Difference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcDifference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcUmar Ali
 
Difference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcDifference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcUmar Ali
 
ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1Umar Ali
 
Link checkers 1
Link checkers 1Link checkers 1
Link checkers 1Umar Ali
 
Affiliate Networks Sites-1
Affiliate Networks Sites-1Affiliate Networks Sites-1
Affiliate Networks Sites-1Umar Ali
 
Technical Video Training Sites- 1
Technical Video Training Sites- 1Technical Video Training Sites- 1
Technical Video Training Sites- 1Umar Ali
 
US News Sites- 1
US News Sites- 1 US News Sites- 1
US News Sites- 1 Umar Ali
 
How to create user friendly file hosting link sites
How to create user friendly file hosting link sitesHow to create user friendly file hosting link sites
How to create user friendly file hosting link sitesUmar Ali
 
Weak hadiths in tamil
Weak hadiths in tamilWeak hadiths in tamil
Weak hadiths in tamilUmar Ali
 
Bulughul Maram in tamil
Bulughul Maram in tamilBulughul Maram in tamil
Bulughul Maram in tamilUmar Ali
 
Asp.net website usage and job trends
Asp.net website usage and job trendsAsp.net website usage and job trends
Asp.net website usage and job trendsUmar Ali
 
Indian news sites- 1
Indian news sites- 1 Indian news sites- 1
Indian news sites- 1 Umar Ali
 
Photo sharing sites- 1
Photo sharing sites- 1 Photo sharing sites- 1
Photo sharing sites- 1 Umar Ali
 
File hosting search engines
File hosting search enginesFile hosting search engines
File hosting search enginesUmar Ali
 
Ajax difference faqs compiled- 1
Ajax difference  faqs compiled- 1Ajax difference  faqs compiled- 1
Ajax difference faqs compiled- 1Umar Ali
 
Dotnet differences compiled -1
Dotnet differences compiled -1Dotnet differences compiled -1
Dotnet differences compiled -1Umar Ali
 
.NET Differences List
.NET Differences List.NET Differences List
.NET Differences ListUmar Ali
 

Mehr von Umar Ali (20)

Difference between wcf and asp.net web api
Difference between wcf and asp.net web apiDifference between wcf and asp.net web api
Difference between wcf and asp.net web api
 
Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()Difference between ActionResult() and ViewResult()
Difference between ActionResult() and ViewResult()
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4
 
Difference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcDifference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvc
 
Difference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvcDifference between asp.net web forms and asp.net mvc
Difference between asp.net web forms and asp.net mvc
 
ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1ASP.NET MVC difference between questions list 1
ASP.NET MVC difference between questions list 1
 
Link checkers 1
Link checkers 1Link checkers 1
Link checkers 1
 
Affiliate Networks Sites-1
Affiliate Networks Sites-1Affiliate Networks Sites-1
Affiliate Networks Sites-1
 
Technical Video Training Sites- 1
Technical Video Training Sites- 1Technical Video Training Sites- 1
Technical Video Training Sites- 1
 
US News Sites- 1
US News Sites- 1 US News Sites- 1
US News Sites- 1
 
How to create user friendly file hosting link sites
How to create user friendly file hosting link sitesHow to create user friendly file hosting link sites
How to create user friendly file hosting link sites
 
Weak hadiths in tamil
Weak hadiths in tamilWeak hadiths in tamil
Weak hadiths in tamil
 
Bulughul Maram in tamil
Bulughul Maram in tamilBulughul Maram in tamil
Bulughul Maram in tamil
 
Asp.net website usage and job trends
Asp.net website usage and job trendsAsp.net website usage and job trends
Asp.net website usage and job trends
 
Indian news sites- 1
Indian news sites- 1 Indian news sites- 1
Indian news sites- 1
 
Photo sharing sites- 1
Photo sharing sites- 1 Photo sharing sites- 1
Photo sharing sites- 1
 
File hosting search engines
File hosting search enginesFile hosting search engines
File hosting search engines
 
Ajax difference faqs compiled- 1
Ajax difference  faqs compiled- 1Ajax difference  faqs compiled- 1
Ajax difference faqs compiled- 1
 
Dotnet differences compiled -1
Dotnet differences compiled -1Dotnet differences compiled -1
Dotnet differences compiled -1
 
.NET Differences List
.NET Differences List.NET Differences List
.NET Differences List
 

KĂĽrzlich hochgeladen

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

KĂĽrzlich hochgeladen (20)

Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

ADO.NET difference faqs compiled- 1

  • 1. ADO.NET Difference FAQs-1 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 Can have more than 1 records time 3 Is ForwardOnly and Readonly Can navigate front and back and editable 4 Faster Slower 2. What are the differences between DataSet and DataReader? S.No DataSet DataReader 1 The data store whose records You can read data from datareader have to be manipulated can be only if the connection to data store disconnected. exists. 2 You have the provision to cache Caching of data is not possible. data fetched from data store when using dataset. 3 Dataset objects have XML XML Support is not provided by Support. datareader. 4 A single dataset object can Datareader can read records contain collection of datatable fetched by a command object objects wherein each datatable containing a single query. If you object refers to a table in the have to fetch data from multiple datastore. Hence you can tables, then datareader is not manipulate on multiple tables advantageous when compared to using a dataset. dataset. 5 Using dataset, you can read the While reading records, you can records fetched in any order. iterate only in forward direction. 6 Performance wise, dataset is Datareader gives high performance slow because it has multiple and records can be fetched faster tables which in turn include when compared to dataset. multiple rows, columns and constraints. 3. What is the difference between DataSet.Copy() and DataSet.Clone()? S.No DataSet.Copy() DataSet.Clone() 1 DataSet.Copy() copies both the DataSet.Clone() copies the structure and data structure of the DataSet, including all DataTable schemas, relations,
  • 2. and constraints and it does not copy any data 4. What are the differences between RecordSet and DataSet? S.No RecordSet DataSet 1 RecordSet provides data of one DataSet is a data structure which row at an instant represents the complete table data at the same time 2 RecordSet always needs an DataSet needs connection only for Open connection to read the retrieving the data. After retrieve the data from data sources data connection is not necessary 3 RecordSet is able to load the DataSet has the capability to store structure and data of only one the structure and data of multiple table at a time tables at a time 4 RecordSet does not support DataSet enforces data integrity by constraints of Databases using Constraints 5. 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 ADO.NET architecture works while the connection with the data store. 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 It uses Dataset Object for data access Recordset to reference data from and representation. the data store. 7 Using Classic ADO, you can Dataset object of ADO.NET includes obtain information from one table collection of DataTables wherein each or set of tables through join. You DataTable will contain records fetched cannot fetch records from multiple from a particular table. Hence multiple tables independently. table records are maintained independently. 8 Firewall might prevent execution ADO.NET has firewall proof and its of Classic ADO. execution will never be interrupted. 9 Classic ADO architecture includes ADO.NET architecture doesn't include client side cursor and server side such cursors. cursor.
  • 3. 10 You cannot send multiple You can send multiple transactions transactions using a single using a single connection instance. connection instance. Reference: http://onlydifferencefaqs.blogspot.in/2012/07/adonet-difference-faqs-1.html ADO.Net Difference FAQs-2 1.Difference between Typed DataSet and Untyped DataSet S.No Typed DataSet Untyped DataSet 1 It provides additional methods, It is not as easy to use as strongly properties and events and thus typed dataset. it makes it easier to use. 2 They have .xsd file (Xml They do not do error checking at Schema definition) file the design time as they are filled at associated with them and do run time when the code executes. error checking regarding their schema at design time using the .xsd definitions. 3 We will get advantage of We cannot get an advantage of intelliSense in VS. NET. intelliSense. 4 Performance is slower in case Performance is faster in case of of strongly typed dataset. Untyped dataset. 5 In complex environment, Untyped datasets are easy to strongly typed dataset's are administer. difficult 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; 2.Difference between DataView and DataTable S.No DataView DataTable 1 Read-only i.e., DataView can Read/Write i.e., Datatable can be be used to select the data. used to edit or select or delete or insert a data.
  • 4. 2 Is a reference to an existing Can be created empty and then DataTable. Cannot be populated populated from scratch; must be instantiated with a reference to an existing DataTable. 3 Data is a reference to an Data takes storage space. existing DataTable, and does not consume space. 4 Can sort or filter rows without Can add/edit/delete rows, columns, modifying the underlying data. and data, and all changes are Rows and columns can be persistent. hidden and revealed repeatedly. 5 Can return a DataTable version Can be cloned of the view 6 A live reference to a Is source data; does not contain DataTable; any changes in the references DataTable data is immediately reflected in the view. 7 Supports calculated columns, Does not support calculated which are columns with a value columns calculated on the fly by combining or manipulating other columns. 8 Can hide or show selected No row or column hiding columns 3.Difference between Connected and Disconnected Environment S.No Connected Environment Disconnected Environment 1 Connected Environment needs Disconnected Environment does a constantly connection of user not need any connection. to data source while performing any operation. 2 Only one operation can be Multiple operations can be performed at a time in performed. connection Environment. 3 DataReader is used in DataSet is used in it. Connection Environment. 4 It is slower in speed. Disconnected Environment has a good speed.
  • 5. 5 We get updated data in it. There is a problem of dirty read. Reference: http://onlydifferencefaqs.blogspot.in/2012/08/adonet-difference-faqs-2.html ADO.NET Difference FAQs-3 1.Difference between ExecuteNonQuery() and ExecuteScalar() methods in ADO.NET S.No ExecuteNonQuery() ExecuteScalar() 1 It will work with Action Queries It will work with Non-Action Queries only that contain aggregate functions. (Create,Alter,Drop,Insert,Updat e,Delete). 2 It returns the count of rows It returns the first row and first effected by the Query. column value of the query result. 3 Return type is int Return type is object. 4 Return value is optional and Return value is compulsory and can be assigned to an integer should be assigned to a variable of variable. required type. Example-1 for ExecuteNonQuery Method -Insert: SqlCommand cmd = new SqlCommand("Insert Into SampleTable Values('1','2')",con); //con is the connection object con.Open(); cmd.ExecuteNonQuery(); //The SQL Insert Statement gets executed Example-2 for ExecuteNonQuery Method - Update: public void UpdateEmployeeEmail() { SqlConnection conn = new SqlConnection(connString)) String sqlQuery = "UPDATE Employee SET empemail='umar.ali@xyz.com' WHERE empid=5; SqlCommand cmd = new SqlCommand(sqlQuery, conn); try { conn.Open(); cmd.ExecuteNonQuery(); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally {
  • 6. conn.Close(); } return count; } Example-1 for ExecuteScalar Method: This returns only one value that is first column value of the first row in the executed query public int getSomeProdId() { int count=0; SqlConnection conn = new SqlConnection(connString)) String sqlQuery = "SELECT COUNT(*) FROM dbo.region"; SqlCommand cmd = new SqlCommand(sqlQuery, conn); try { conn.Open(); //Since return type is System.Object, a typecast is must count = (Int32)cmd.ExecuteScalar(); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { conn.Close(); } return count; } Example-2 for ExecuteScalar Method: This returns one value only, no recordsets. cmd.CommandText = "Select Name, DOB, from Emp where ID=1"; Dim strName As string = cmd.ExecuteScalar.ToString 2.Difference between ExecuteNonQuery() and ExecuteReader() methods in ADO.NET S.No ExecuteNonQuery() ExecuteReader() 1 It will work with Action Queries It will work with Action and Non- only Action Queries (Select) (Create,Alter,Drop,Insert,Updat e,Delete).
  • 7. 2 It returns the count of rows It returns the collection of rows effected by the Query. selected by the Query. 3 Return type is int Return type is DataReader. 4 Return value is optional and Return value is compulsory and can be assigned to an integer should be assigned to an another variable. object DataReader. Example-1 for ExecuteNonQuery Method -Insert: SqlCommand cmd = new SqlCommand("Insert Into SampleTable Values('1','2')",con); //con is the connection object con.Open(); cmd.ExecuteNonQuery(); //The SQL Insert Statement gets executed Example-2 for ExecuteNonQuery Method - Update: public void UpdateEmployeeEmail() { SqlConnection conn = new SqlConnection(connString)) String sqlQuery = "UPDATE Employee SET empemail='umar.ali@xyz.com' WHERE empid=5; SqlCommand cmd = new SqlCommand(sqlQuery, conn); try { conn.Open(); cmd.ExecuteNonQuery(); } catch (Exception ex) { Console.WriteLine(ex.Message); } finally { conn.Close(); } return count; } Example for ExecuteReader Method: Here, ExecuteReader is used to get set of records by specified query, namely, "select * from emp" SqlConnection con = new SqlConnection(constr); //constructor can be connection of string. SqlCommand cmd = new SqlCommand ("select * from emp", con); con.Open(); SqlDataReader dr = cmd. ExecuteReader (CommandBehavior. CloseConnection); //Implicitly closes the connection because CommandBehavior. CloseConnection was specified.