Building Effective Web Applications with ASP .Net 3.5 - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Building Effective Web Applications with ASP .Net 3.5

Description:

Please feel free to post questions and discuss development ... Offers compile time checking, autocompletion, and Intellisense. New C# Language Features ... – PowerPoint PPT presentation

Number of Views:9743
Avg rating:3.0/5.0
Slides: 25
Provided by: NoahS8
Category:

less

Transcript and Presenter's Notes

Title: Building Effective Web Applications with ASP .Net 3.5


1
Building Effective Web Applications with ASP .Net
3.5
  • Noah Subrin
  • SRA University
  • Fall 2008
  • Week 2

2
Todays Agenda
  • Student QA
  • Week 1 Optional Homework Review
  • Data Access
  • Data bound controls
  • DataSources
  • LINQ to SQL

3
Student Feedback\QA
  • Please feel free to post questions and discuss
    development questions on our class collaborative
    site on the SRA portal
  • Web.config files in multiple environments
  • Layout of controls on web forms
  • JavaScript debugging
  • Traditional .Net Framework development vs. .Net
    MVC

4
Optional Homework Virtual Lab or VS2008
Training Kit
  • Also can be found as part of VS2008 Training Kit
    Lab Building Web Applications with VS2008
  • Use the CSS designer to create new styles
  • Create an image summary page using LINQ classes
  • Add ListView and DataPager controls and add paging

5
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 applications UI
  • SQL Server Express is a royalty free database
    included with VS2008 or Visual Web Developer.

6
Types of Data bound Controls p337
  • Lists
  • Tabular
  • Hierarchical

7
Bind Controls to a DataSource p350
  • SQLDataSource
  • LinqDataSource
  • AccessDataSource
  • ObjectDataSource
  • XmlDataSource
  • SiteMapDataSource

8
Data Driven App Demos
  • Code From Chapter 8
  • Add/Configure a SQLDataSource
  • List Controls
  • Tabular
  • Hierarchical Data
  • This demo uses an xml file as a data source.
  • CRUD Sample Employee Directory

9
Break
  • We will look discuss LINQ after break

10
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

11
LINQ Architecture
C 3.0
VB 9.0
Others
.NET Language Integrated Query
LINQ toObjects
LINQ toSQL
LINQ toXML
LINQ toDataSets
ltbookgt lttitle/gt ltauthor/gt ltyear/gt
ltprice/gt lt/bookgt
Objects
Relational
XML
12
Benefits of Using LINQ
  • May not need to build an entire DAL (data access
    layer)
  • Much easier to query XML dont 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

13
New C Language Featuresthat Support LINQ p902
  • Automatic properties
  • Initializers
  • Type Inference
  • Anonymous types

14
Three Parts of a LINQ Query
  • Obtain the data source
  • Create the query
  • Execute the query

15
Whats 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.

16
LINQ Demos from MSDN Library Help Files
  • How to Query an ArrayList with LINQ
  • LINQ to XML vs. DOM
  • Paste as XML C Addin

17
C Building the Paste Xelement as XML Addin
  • http//www.hanselman.com/blog/PasteXMLAsXLinqXElem
    entVisualStudioAddIn.aspx

18
Creating LINQ to SQL Entities
  • Building Entities with the Object Relational
    Designer p922
  • Using the LINQDataSource control
  • p926

19
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

20
Other LINQ resources
  • www.thinqlinq.com
  • Book LINQ in Action
  • Msdn.microsoft.com articles on LINQ

21
More on JavaScript Debugging
  • Scott Guthries blog
  • http//weblogs.asp.net/scottgu/archive/2007/07/19/
    vs-2008-javascript-debugging.aspx

22
Optional Take Home Class Exercise
  • Do any one of the following
  • MSDN Virtual Lab Using LINQ to SQL with the .Net
    Framework 3.5 and Visual Studio 2008 Event ID
    1032376015 (msevents.microsoft.com)
  • Download lab manual from 1, install Northwind
    database and do lab on your pc.
  • Do VS2008 Training Kit Lab LinqToSql

23
Next Week
  • Week 2 QA
  • Homework Review (Take home lab)
  • Chapters 31-33 (AJAX)

24
Questions ?
  • Feel free to contact me at noah_subrin_at_sra.com
  • Please use the class portal site on the SRA
    portal to post question or other discussions that
    may be of interest to the class.
  • Thank you!
Write a Comment
User Comments (0)
About PowerShow.com