SlideShare una empresa de Scribd logo
1 de 11
LINQ TO SQL
AGENDA
• INTRODUCTION TO LINQ

• LINQ AND .NET FRAMEWORK

• What is Data Context Object?

• Working of LINQ.

• LINQ TO SQL (WITH EXAMPLES)
INTRODUCTION TO LINQ
• LINQ stands for Language Integrated Querying.

• Language Integrated Querying (LINQ) is Microsoft’s first
  attempt to integrate Queries into a Language.

• Model which overcomes the traditional approach to access
  data.

• Visual Studio provides IntelliSense Features and also integrated
  debugger to debug queries.

• LINQ can interact with any kind of data source and hence reduces
  the headaches of learning new techniques.
LINQ and Dot Net Framework

      C# 3.0                   VB 9.0                  OTHERS


       DOT NET LANGUAGE INTEGRATED QUERY - LINQ

  LINQ TO            LINQ TO                 LINQ TO    LINQ TO
                               LINQ TO SQL
COLLECTIONS          DATASET                   XML      ENTITIES



       OBJ
        1
                                                          XML
OBJ            OBJ                                        FILE
 2              3

  OBJECTS                      DATABASES                   XML
What is DataContext Object?

• DataContext is a Class, which helps creating a connection with
  the database.

• It represents the Tables and the Stored Procedures we created in
  the database.

• Helps to create and delete a Database. Provides
  CreateDatabase() and DeleteDatabase() functions.

• It submits the information sent using Objects and make changes
  in the database.
Working of LINQ
• Sending data from Application to the database is a 2 step process
  in Linq.

• Database Operation is done by Data Context Object. Data is
  transferred from the Entity to the DataContext Object.

• LINQ provides “InsertOnSubmit()”, “DeleteOnSubmit()” to do the
  in-memory operations.

• For applying the changes in the physical database, the
  “SubmitChanges()” has to be called.
LINQ TO SQL EXAMPLE
Bibliography
• http://www.codeproject.com/Articles/33900/LI
  NQ-FAQ-for-Newbie-s

• http://www.codeproject.com/Articles/38056/LI
  NQ-FAQ-Part-2

• http://www.codeproject.com/Articles/38010/C
  RUD-Operations-using-LINQ-Entities

• http://www.codeproject.com/Articles/32004/S
  ALT-and-PEPPER-3-TIER-and-LINQ#Inconsistent
  DAL component
THANK YOU

Más contenido relacionado

La actualidad más candente

Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Simplilearn
 

La actualidad más candente (20)

Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
 
REST API
REST APIREST API
REST API
 
Spring boot
Spring bootSpring boot
Spring boot
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Linq
LinqLinq
Linq
 
Selenium with Cucumber
Selenium  with Cucumber Selenium  with Cucumber
Selenium with Cucumber
 
Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with Flyway
 
Test your microservices with REST-Assured
Test your microservices with REST-AssuredTest your microservices with REST-Assured
Test your microservices with REST-Assured
 
Automated testing using Selenium & NUnit
Automated testing using Selenium & NUnitAutomated testing using Selenium & NUnit
Automated testing using Selenium & NUnit
 
reactJS
reactJSreactJS
reactJS
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Introduction to selenium
Introduction to seleniumIntroduction to selenium
Introduction to selenium
 
Database migrations with Flyway and Liquibase
Database migrations with Flyway and LiquibaseDatabase migrations with Flyway and Liquibase
Database migrations with Flyway and Liquibase
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 

Destacado (9)

Linq
LinqLinq
Linq
 
LINQ
LINQLINQ
LINQ
 
jQuery
jQueryjQuery
jQuery
 
Introducing LINQ
Introducing LINQIntroducing LINQ
Introducing LINQ
 
Understanding linq
Understanding linqUnderstanding linq
Understanding linq
 
Linq
LinqLinq
Linq
 
LINQ and LINQPad
LINQ and LINQPadLINQ and LINQPad
LINQ and LINQPad
 
OPC Unified Architecture
OPC Unified ArchitectureOPC Unified Architecture
OPC Unified Architecture
 
Introduccion a LINQ
Introduccion a LINQIntroduccion a LINQ
Introduccion a LINQ
 

Similar a Linq to sql

Inb343 week2 sql server intro
Inb343 week2 sql server introInb343 week2 sql server intro
Inb343 week2 sql server intro
Fredlive503
 

Similar a Linq to sql (20)

Linq
LinqLinq
Linq
 
Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2Asp.Net 3.5 Part 2
Asp.Net 3.5 Part 2
 
Linq in C#
Linq in C#Linq in C#
Linq in C#
 
The LINQ Between XML and Database
The LINQ Between XML and DatabaseThe LINQ Between XML and Database
The LINQ Between XML and Database
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
LINQ PPT.pptx
LINQ PPT.pptxLINQ PPT.pptx
LINQ PPT.pptx
 
Linq to xml
Linq to xmlLinq to xml
Linq to xml
 
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource GroupLINQ 2 SQL Presentation To Palmchip  And Trg, Technology Resource Group
LINQ 2 SQL Presentation To Palmchip And Trg, Technology Resource Group
 
SQLite - Dynamic Data in Titanium
SQLite - Dynamic Data in TitaniumSQLite - Dynamic Data in Titanium
SQLite - Dynamic Data in Titanium
 
Inb343 week2 sql server intro
Inb343 week2 sql server introInb343 week2 sql server intro
Inb343 week2 sql server intro
 
Linq difference faqs- 1
Linq difference faqs- 1Linq difference faqs- 1
Linq difference faqs- 1
 
LINQ-Introduction.ppt
LINQ-Introduction.pptLINQ-Introduction.ppt
LINQ-Introduction.ppt
 
A case for teaching SQL to scientists
A case for teaching SQL to scientistsA case for teaching SQL to scientists
A case for teaching SQL to scientists
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
 
Iterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternIterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design pattern
 
LINQ/PLINQ
LINQ/PLINQLINQ/PLINQ
LINQ/PLINQ
 
NHDay Introduction to LINQ2NH
NHDay Introduction to LINQ2NHNHDay Introduction to LINQ2NH
NHDay Introduction to LINQ2NH
 
The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...
The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...
The Boss: A Petascale Database for Large-Scale Neuroscience, Powered by Serve...
 
Intake 37 linq3
Intake 37 linq3Intake 37 linq3
Intake 37 linq3
 
Chapter -7.pptx
Chapter -7.pptxChapter -7.pptx
Chapter -7.pptx
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Linq to sql

  • 2. AGENDA • INTRODUCTION TO LINQ • LINQ AND .NET FRAMEWORK • What is Data Context Object? • Working of LINQ. • LINQ TO SQL (WITH EXAMPLES)
  • 3. INTRODUCTION TO LINQ • LINQ stands for Language Integrated Querying. • Language Integrated Querying (LINQ) is Microsoft’s first attempt to integrate Queries into a Language. • Model which overcomes the traditional approach to access data. • Visual Studio provides IntelliSense Features and also integrated debugger to debug queries. • LINQ can interact with any kind of data source and hence reduces the headaches of learning new techniques.
  • 4. LINQ and Dot Net Framework C# 3.0 VB 9.0 OTHERS DOT NET LANGUAGE INTEGRATED QUERY - LINQ LINQ TO LINQ TO LINQ TO LINQ TO LINQ TO SQL COLLECTIONS DATASET XML ENTITIES OBJ 1 XML OBJ OBJ FILE 2 3 OBJECTS DATABASES XML
  • 5. What is DataContext Object? • DataContext is a Class, which helps creating a connection with the database. • It represents the Tables and the Stored Procedures we created in the database. • Helps to create and delete a Database. Provides CreateDatabase() and DeleteDatabase() functions. • It submits the information sent using Objects and make changes in the database.
  • 6.
  • 7. Working of LINQ • Sending data from Application to the database is a 2 step process in Linq. • Database Operation is done by Data Context Object. Data is transferred from the Entity to the DataContext Object. • LINQ provides “InsertOnSubmit()”, “DeleteOnSubmit()” to do the in-memory operations. • For applying the changes in the physical database, the “SubmitChanges()” has to be called.
  • 8.
  • 9. LINQ TO SQL EXAMPLE
  • 10. Bibliography • http://www.codeproject.com/Articles/33900/LI NQ-FAQ-for-Newbie-s • http://www.codeproject.com/Articles/38056/LI NQ-FAQ-Part-2 • http://www.codeproject.com/Articles/38010/C RUD-Operations-using-LINQ-Entities • http://www.codeproject.com/Articles/32004/S ALT-and-PEPPER-3-TIER-and-LINQ#Inconsistent DAL component