SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
Building Effective Web
Applications with ASP .Net 3.5


                 ASIM SHAHZAD
Overview of Data Access
          (Chapter 8)
• 99.99% of apps involve some type of data
• We can use data bound controls to
  generate our web application’s UI
• SQL Server Express is a royalty free
  database included with VS2008 or Visual
  Web Developer.
Types of Data bound Controls
             p337
• Lists
• Tabular
• Hierarchical
Bind Controls to a DataSource
                p350
•   SQLDataSource
•   LinqDataSource
•   AccessDataSource
•   ObjectDataSource
•   XmlDataSource
•   SiteMapDataSource
Data Driven App Demos
• Code From Chapter 8
1.Add/Configure a SQLDataSource
2.List Controls
3.Tabular
4.Hierarchical Data
  This demo uses an xml file as a data
  source.
5.CRUD Sample – Employee Directory
Break
• We will look discuss LINQ after break
What is LINQ?
• LINQ stands for Language Integrated
  Query
• A general purpose query facility to
  query relational data, XML data,
  objects/collections.
• New in .Net Framework 3.5 – must
  target .Net Framework 3.5
• Based on standard query operators
• LINQ query syntax resembles
  backwards SQL statements
LINQ Architecture

    C# 3.0              VB 9.0
.NET Language Integrated Query Others…

  LINQ to    LINQ to      LINQ to   LINQ to
  Objects    DataSets       SQL       XML


                                       <book>
                                         <title/>
                                         <author/>
                                         <year/>
                                         <price/>
                                       </book>



Objects             Relational
                                         XML
Benefits of Using LINQ
• May not need to build an entire DAL
  (data access layer)
• Much easier to query XML – don’t
  have to use Xpath
• Work with data in a consistent way –
  whether it is SQL Server data, XML
  data, ADO .Net dataset, an object
  collection, or data in memory
• Offers compile time checking,
  autocompletion, and Intellisense
New C# Language Features
     that Support LINQ p902
•   Automatic properties
•   Initializers
•   Type Inference
•   Anonymous types
Three Parts of a LINQ Query
• Obtain the data source
• Create the query
• Execute the query
What’s a DataContext?
• The DataContext is the source of all
  entities mapped over a database
  connection
• It tracks changes that you made to all
  retrieved entities and maintains an
  "identity cache" that guarantees that
  entities retrieved more than one time are
  represented by using the same object
  instance.
LINQ Demos from MSDN
       Library Help Files
• How to: Query an ArrayList with LINQ
• LINQ to XML vs. DOM
• Paste as XML C# Addin
C# Building the Paste Xelement
         as XML Addin
• http://www.hanselman.com/blog/PasteXM
  LAsXLinqXElementVisualStudioAddIn.asp
  x
Creating LINQ to SQL Entities
• Building Entities with the Object Relational
  Designer p922
• Using the LINQDataSource control
  p926
Other MVC Resources
• MSDN Virtual Lab on Introduction to
  .Net MVC
• Discussion of .Net MVC can be found
  on www.asp.net/mvc/
• Book - Design Patterns by Gamma,
  Helm, Johnson, and Vlissides
Other LINQ resources
• www.thinqlinq.com
• Book – LINQ in Action
• Msdn.microsoft.com articles on LINQ
Optional Take Home Class
           Exercise
• Do any one of the following:
1.MSDN Virtual Lab “Using LINQ to SQL
  with the .Net Framework 3.5 and Visual
  Studio 2008” Event ID: 1032376015
      (msevents.microsoft.com)
2. Download lab manual from #1, install
  Northwind database and do lab on your
  pc.
3.Do VS2008 Training Kit Lab “LinqToSql”
Questions ?
• Feel free to contact me at
  asimshahzad78@yahoo.com
• Thank you!

Mais conteúdo relacionado

Mais procurados

Counters with Riak on Amazon EC2 at Hackover
Counters with Riak on Amazon EC2 at HackoverCounters with Riak on Amazon EC2 at Hackover
Counters with Riak on Amazon EC2 at Hackover
Andrei Savu
 
Web 10mca556 syllabs
Web 10mca556 syllabsWeb 10mca556 syllabs
Web 10mca556 syllabs
Ramesh Bindu
 

Mais procurados (20)

2016 SUTOL: React.js – High-Performance Client for Domino
2016 SUTOL: React.js – High-Performance Client for Domino2016 SUTOL: React.js – High-Performance Client for Domino
2016 SUTOL: React.js – High-Performance Client for Domino
 
Slick - The Structured Way
Slick - The Structured WaySlick - The Structured Way
Slick - The Structured Way
 
GlueCon 2015 - Publish your SQL data as web APIs
GlueCon 2015 - Publish your SQL data as web APIsGlueCon 2015 - Publish your SQL data as web APIs
GlueCon 2015 - Publish your SQL data as web APIs
 
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormationTear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
Tear It Down, Build It Back Up: Empowering Developers with Amazon CloudFormation
 
Alex Thissen "Server-less compute with .NET based Azure Functions"
Alex Thissen "Server-less compute with .NET based Azure Functions"Alex Thissen "Server-less compute with .NET based Azure Functions"
Alex Thissen "Server-less compute with .NET based Azure Functions"
 
C# 8 and .NET Core 3
C# 8 and .NET Core 3C# 8 and .NET Core 3
C# 8 and .NET Core 3
 
Data Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDCData Stream Processing for Beginners with Kafka and CDC
Data Stream Processing for Beginners with Kafka and CDC
 
Hack angular wildly
Hack angular wildlyHack angular wildly
Hack angular wildly
 
Counters with Riak on Amazon EC2 at Hackover
Counters with Riak on Amazon EC2 at HackoverCounters with Riak on Amazon EC2 at Hackover
Counters with Riak on Amazon EC2 at Hackover
 
Logging in The World of DevOps
Logging in The World of DevOps Logging in The World of DevOps
Logging in The World of DevOps
 
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA....NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
.NET Core Foundations - Dependency Injection, Logging & Configuration - BASTA...
 
Cloud Abstraction Libraries: Implementation and Comparison
Cloud Abstraction Libraries: Implementation and ComparisonCloud Abstraction Libraries: Implementation and Comparison
Cloud Abstraction Libraries: Implementation and Comparison
 
Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014Tips & Tricks SQL in the City Seattle 2014
Tips & Tricks SQL in the City Seattle 2014
 
Flink September 2015 Community Update
Flink September 2015 Community UpdateFlink September 2015 Community Update
Flink September 2015 Community Update
 
C# 9 - What's the cool stuff? - BASTA! Spring 2021
C# 9 - What's the cool stuff? - BASTA! Spring 2021C# 9 - What's the cool stuff? - BASTA! Spring 2021
C# 9 - What's the cool stuff? - BASTA! Spring 2021
 
Azure App Configuration with .NET applications
Azure App Configuration with .NET applicationsAzure App Configuration with .NET applications
Azure App Configuration with .NET applications
 
UWP apps development - Part 2
UWP apps development - Part 2UWP apps development - Part 2
UWP apps development - Part 2
 
Searchlight + Horizon - Mitaka march 2016
Searchlight  + Horizon - Mitaka march 2016Searchlight  + Horizon - Mitaka march 2016
Searchlight + Horizon - Mitaka march 2016
 
Web 10mca556 syllabs
Web 10mca556 syllabsWeb 10mca556 syllabs
Web 10mca556 syllabs
 
Mindtalk Tech - Behind the scenes
Mindtalk Tech - Behind the scenesMindtalk Tech - Behind the scenes
Mindtalk Tech - Behind the scenes
 

Destaque

Computer fundamentals
Computer fundamentalsComputer fundamentals
Computer fundamentals
nilesh67
 

Destaque (20)

Creating a Plug-In Architecture
Creating a Plug-In ArchitectureCreating a Plug-In Architecture
Creating a Plug-In Architecture
 
Asp dot net long
Asp dot net longAsp dot net long
Asp dot net long
 
Computer fundamentals
Computer fundamentalsComputer fundamentals
Computer fundamentals
 
Your First ASP_Net project part 1
Your First ASP_Net project part 1Your First ASP_Net project part 1
Your First ASP_Net project part 1
 
Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)
 
Parallelminds.asp.net with sp
Parallelminds.asp.net with spParallelminds.asp.net with sp
Parallelminds.asp.net with sp
 
Miao
MiaoMiao
Miao
 
Review Materi ASP.NET
Review Materi ASP.NETReview Materi ASP.NET
Review Materi ASP.NET
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
 
E sampark with c#.net
E sampark with c#.netE sampark with c#.net
E sampark with c#.net
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1
 
Computer Notes
Computer Notes Computer Notes
Computer Notes
 
Hellstorm (the truth about world war 2 and the aftermath
Hellstorm (the truth about world war 2 and the aftermathHellstorm (the truth about world war 2 and the aftermath
Hellstorm (the truth about world war 2 and the aftermath
 
The Fruit Grower's Guide, by John Wright (1891)
The Fruit Grower's Guide, by John Wright (1891)The Fruit Grower's Guide, by John Wright (1891)
The Fruit Grower's Guide, by John Wright (1891)
 
Curse of-canaan-eustace-mullins
Curse of-canaan-eustace-mullinsCurse of-canaan-eustace-mullins
Curse of-canaan-eustace-mullins
 
Fruit Culture, Volume 1; by International Library of Technology (1912)
Fruit Culture,  Volume 1; by International Library of Technology (1912) Fruit Culture,  Volume 1; by International Library of Technology (1912)
Fruit Culture, Volume 1; by International Library of Technology (1912)
 
ASP
ASPASP
ASP
 
The bad war[the truth never told about world war2]
The bad war[the truth never told about world war2]The bad war[the truth never told about world war2]
The bad war[the truth never told about world war2]
 
Computer Notes
Computer NotesComputer Notes
Computer Notes
 

Semelhante a Asp.Net 3.5 Part 2

SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...
Liam Cleary [MVP]
 

Semelhante a Asp.Net 3.5 Part 2 (20)

Understanding LINQ in C#
Understanding LINQ in C# Understanding LINQ in C#
Understanding LINQ in C#
 
70487.pdf
70487.pdf70487.pdf
70487.pdf
 
Linq to xml
Linq to xmlLinq to xml
Linq to xml
 
Linq in C#
Linq in C#Linq in C#
Linq in C#
 
Asp.net
Asp.netAsp.net
Asp.net
 
NoSql Data Management
NoSql Data ManagementNoSql Data Management
NoSql Data Management
 
Linq to sql
Linq to sqlLinq to sql
Linq to sql
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET Platform
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
C# advanced topics and future - C#5
C# advanced topics and future - C#5C# advanced topics and future - C#5
C# advanced topics and future - C#5
 
SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...SharePoint Saturday The Conference DC - How the client object model saved the...
SharePoint Saturday The Conference DC - How the client object model saved the...
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
 
Serverless Web Apps using API Gateway, Lambda and DynamoDB
Serverless Web Apps using API Gateway, Lambda and DynamoDBServerless Web Apps using API Gateway, Lambda and DynamoDB
Serverless Web Apps using API Gateway, Lambda and DynamoDB
 
Autogenerate Awesome GraphQL Documentation with SpectaQL
Autogenerate Awesome GraphQL Documentation with SpectaQLAutogenerate Awesome GraphQL Documentation with SpectaQL
Autogenerate Awesome GraphQL Documentation with SpectaQL
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
 
Linq To XML Overview
Linq To XML OverviewLinq To XML Overview
Linq To XML Overview
 
LINQ-Introduction.ppt
LINQ-Introduction.pptLINQ-Introduction.ppt
LINQ-Introduction.ppt
 
Serverless Reality
Serverless RealityServerless Reality
Serverless Reality
 

Mais de asim78 (9)

Web Introduction
Web IntroductionWeb Introduction
Web Introduction
 
Ado Fundamentals
Ado FundamentalsAdo Fundamentals
Ado Fundamentals
 
Project Manangement Introduction
Project Manangement IntroductionProject Manangement Introduction
Project Manangement Introduction
 
Software Project Management
Software Project ManagementSoftware Project Management
Software Project Management
 
Project Quality Management
Project Quality ManagementProject Quality Management
Project Quality Management
 
Procurement
ProcurementProcurement
Procurement
 
PMP Flash Card
PMP Flash CardPMP Flash Card
PMP Flash Card
 
Hr Management
Hr ManagementHr Management
Hr Management
 
6 Steps For Pmp
6 Steps For Pmp6 Steps For Pmp
6 Steps For Pmp
 

Último

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)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
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
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"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 ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
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...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Asp.Net 3.5 Part 2

  • 1. Building Effective Web Applications with ASP .Net 3.5 ASIM SHAHZAD
  • 2. Overview of Data Access (Chapter 8) • 99.99% of apps involve some type of data • We can use data bound controls to generate our web application’s UI • SQL Server Express is a royalty free database included with VS2008 or Visual Web Developer.
  • 3. Types of Data bound Controls p337 • Lists • Tabular • Hierarchical
  • 4. Bind Controls to a DataSource p350 • SQLDataSource • LinqDataSource • AccessDataSource • ObjectDataSource • XmlDataSource • SiteMapDataSource
  • 5. Data Driven App Demos • Code From Chapter 8 1.Add/Configure a SQLDataSource 2.List Controls 3.Tabular 4.Hierarchical Data This demo uses an xml file as a data source. 5.CRUD Sample – Employee Directory
  • 6. Break • We will look discuss LINQ after break
  • 7. What is LINQ? • LINQ stands for Language Integrated Query • A general purpose query facility to query relational data, XML data, objects/collections. • New in .Net Framework 3.5 – must target .Net Framework 3.5 • Based on standard query operators • LINQ query syntax resembles backwards SQL statements
  • 8. LINQ Architecture C# 3.0 VB 9.0 .NET Language Integrated Query Others… LINQ to LINQ to LINQ to LINQ to Objects DataSets SQL XML <book> <title/> <author/> <year/> <price/> </book> Objects Relational XML
  • 9. Benefits of Using LINQ • May not need to build an entire DAL (data access layer) • Much easier to query XML – don’t have to use Xpath • Work with data in a consistent way – whether it is SQL Server data, XML data, ADO .Net dataset, an object collection, or data in memory • Offers compile time checking, autocompletion, and Intellisense
  • 10. New C# Language Features that Support LINQ p902 • Automatic properties • Initializers • Type Inference • Anonymous types
  • 11. Three Parts of a LINQ Query • Obtain the data source • Create the query • Execute the query
  • 12. What’s a DataContext? • The DataContext is the source of all entities mapped over a database connection • It tracks changes that you made to all retrieved entities and maintains an "identity cache" that guarantees that entities retrieved more than one time are represented by using the same object instance.
  • 13. LINQ Demos from MSDN Library Help Files • How to: Query an ArrayList with LINQ • LINQ to XML vs. DOM • Paste as XML C# Addin
  • 14. C# Building the Paste Xelement as XML Addin • http://www.hanselman.com/blog/PasteXM LAsXLinqXElementVisualStudioAddIn.asp x
  • 15. Creating LINQ to SQL Entities • Building Entities with the Object Relational Designer p922 • Using the LINQDataSource control p926
  • 16. Other MVC Resources • MSDN Virtual Lab on Introduction to .Net MVC • Discussion of .Net MVC can be found on www.asp.net/mvc/ • Book - Design Patterns by Gamma, Helm, Johnson, and Vlissides
  • 17. Other LINQ resources • www.thinqlinq.com • Book – LINQ in Action • Msdn.microsoft.com articles on LINQ
  • 18. Optional Take Home Class Exercise • Do any one of the following: 1.MSDN Virtual Lab “Using LINQ to SQL with the .Net Framework 3.5 and Visual Studio 2008” Event ID: 1032376015 (msevents.microsoft.com) 2. Download lab manual from #1, install Northwind database and do lab on your pc. 3.Do VS2008 Training Kit Lab “LinqToSql”
  • 19. Questions ? • Feel free to contact me at asimshahzad78@yahoo.com • Thank you!