Working with Data Lesson 4. Objectives DataSource Controls A requirement for most modern Web sites is that they be dynamic. –Static pages are not often.

Slides:



Advertisements
Similar presentations
Internetteknologi (ITNET2) Presentation 21: ASP.NET Advanced.
Advertisements

Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
User Controls, Master Pages, GridView. Content User Controls Styles, Themes, Master Pages Working with Data GridView Muzaffer DOĞAN - Anadolu University2.
Unit 5: Building Presentation Layer Applications with ASP.NET 2.0.
ASP.NET Data Binding. Slide 2 Lecture Overview Understanding the ASP.NET data binding model.
Introduction to Database Processing with ADO.NET.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
ASP.NET Programming with C# and SQL Server First Edition
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Objective In this session we will discuss about : What is ADO. NET ?
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
Rajeswari Indupuri Introduction to.NET Framework.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Some Basic Database Terminology
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Chapter 9 Using the SqlDataSource Control. References aspx.
Chapter 10 Managing Data with ASP.NET. ASP.NET 2.0, Third Edition2.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
ASP.NET Part 4 Instructor: Charles Moen CSCI/CINF 4230.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
Developing Web Applications Using Microsoft ® Visual Studio ® 2008.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
Meeting #6 – April 2011 – Web-Technologies Homework Assignments Svetlin Nakov Telerik Corporation
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. Data Binding in ASP.NET.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Boost data-driven application development using SQL Server Centric.NET Code Generator David Rodriguez SQL Server Technology Specialist Microsoft Corporation.
Session 8: ADO.NET. Overview Overview of ADO.NET What is ADO.NET? Using Namespaces The ADO.NET Object Model What is a DataSet? Accessing Data with ADO.NET.
Chapter 8 Working With Databases in ASP.NET. Listing 8.1 – ShowListControls Uses The SqlDataSource control for estabishing database connectivity and.
Database Handling, Sessions, and AJAX. Post Back ASP.NET Functionality The IsPostBack method in ASP.NET is similar to the BlackBerry.refresh method –IsPostBack.
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
EntityFrame work and LINQ CH 14. linq LINQ enables you to query data from a wide variety of data sources, directly from your programming code. LINQ is.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
Ventsislav Popov Crossroad Ltd.. 1. ASP.NET Data Source Controls  SqlDataSource  EntityDataSource  ObjectDataSource 2. Entity Data Model and ADO.NET.
Module 8: Creating User Controls. Overview Adding User Controls to an ASP.NET Web Form Creating User Controls.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
ADO.NET FUNDAMENTALS BEGINNING ASP.NET 3.5 IN C#.
Module 4 Introduction ADO.NET.
ASP.NET Data Binding. Slide 2 Lecture Overview Understanding the ASP.NET data binding model.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
Module 10: Data Access in ASP.NET. Overview Overview of the ASP.NET Data Access What is Data Access List of Data Source Control What is Data Bound How.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
ASP.NET Programming with C# and SQL Server First Edition
Introduction to Database Processing with ADO.NET
Current Popular IT I Pertemuan 5
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Introduction to Database Processing with ADO.NET
Running a Forms Developer Application
Web Technologies IT230 Dr Mohamed Habib.
.NET Framework 2.0 .NET Framework 3.0 .NET Framework 3.5
Introduction to Visual Basic 2008 Programming
Introduction to .NET Framework Ch2 – Deitel’s Book
Module 1: Getting Started
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
Brief description on how to navigate within this presentation (ppt)
Using JDeveloper.
Chapter 10 ADO.
Database Applications
Chapter 10 Accessing Database Files
Visual Studio 2005 IDE Features
Presentation transcript:

Working with Data Lesson 4

Objectives

DataSource Controls A requirement for most modern Web sites is that they be dynamic. –Static pages are not often revisited. One of the most efficient ways to accomplish this is by connecting Web pages to a database, and ASP.NET provides all the controls you need. Most of the Microsoft DataSource controls are capable of reading data as well as changing the data at the source.

LinqDataSource Control The LinqDataSource control is the latest control used for the communication between ASP.NET Web pages and the database. –It can be applied without having to type a single line of code. –The developer can opt to have all code written automatically by ASP.NET.

Adding the LINQ Connection

ObjectDataSource Control Unlike the LinqDataSource, the ObjectDataSource control does not retrieve data from a database. The purpose of this object is to move any needed data connections along with any needed Input/Output activities of the database, or any other data source, to a location outside the Web page. A Web page does not need to know where the data is coming from nor where it is going. All the page needs to do is ask the ObjectDataSource for the data when it needs it and send it to the ObjectDataSource to save changes.

XmlDataSource In its simplest form, the XmlDataSource control is a rather crude control because it is incapable of deciphering the language of XML. However, when used with a file that provides the rules, it becomes a complex powerhouse for handling XML documents.

SqlDataSource The SqlDataSource control enables you to connect and interact with any database supported by ADO.NET.

Binding Controls To make your page a little more dynamic, you may want to perform the data binding in code.

Connecting the GridView Control

Data-Aware Controls The simplest definition of ASP.NET data- aware controls is that they are all the controls having the DataSource and DataSourceID properties. Data-bound controls, on the other hand, are data-aware controls that have been bound to a specific data source. It is not required for all data-aware controls to be data-bound.

Data-Aware Controls Standard Category DropDownList ListBox CheckBoxList RadioButtonList BulletedList AdRotator Data Category GridView DataList DetailsView FormView Repeater ListView Navigation Category Menu TreeView

Adding Items to an Unbound Data-Aware Control

Managing Data Connections and Databases ASP.NET uses ADO.NET to handle all of its database connections. The compiled code that ASP.NET generates from your.NET programs and objects is called managed code. Managed code is created to run on Microsoft’s Common Language Runtime (CLR) rather than creating an executable that is limited to a particular hardware platform.

Managing Data Connections and Databases ADO.NET also allows us to write provider-independent code so the program is able to connect to a variety of data sources. Several of the.NET database connections are also referred to as data providers because each is designed to work with specific database management systems. Microsoft’s Component Object Model (COM), introduced in 1993, is a technology that enables software components to communicate. –The database is only one of the many components that COM manages.

Providing Data for ADO.NET Applications There are two basic categories to provide data for ADO.NET applications: –Direct connections to specific data sources –The more general connections that provide connectivity to a variety of data sources. The direct connections, such as the SQLConnection, are faster and more efficient than the general connections. However, these more general connections, such as ODBC and OleDB, have the important role of connecting to many of the legacy data sources.

IntelliSense Lists ADO.NET Namespaces for Both New and Old Ways for Database Communication

Using ADO.NET to Connect to ODBC

Using ADO.NET to Connect to OleDB

Connection Object The database connection object is the closest object to the data source. You have three connection objects to connect to our database: –SqlConnection –OleDB –ODBC

Connection Pool A connection pool is a collection of open data connections that Web applications presumed were closed. All.NET data providers support connection pooling including SQL Server, OleDB, ODBC, and Oracle. Although there are many settings available for us to use to fine-tune the service, most applications work fine with the defaults. If changes are made, third-party applications are available to monitor the changes in performance or you can write your own simulations.

Transaction Objects A transaction object allows multiple SQL statements to be processed as a group. If any of the statements in the group fail, all the statements in the group that have been processed will be rolled back and the whole transaction is aborted. ASP.NET includes the transaction object that allows us to do this in code.

ACID Test for Transactions

Summary Using the LinqDataSource control. Using the ObjectDataSource control. Using the XmlDataSource control. Using the SqlDataSource control. Using data-binding syntax. Using a data-aware control. Examining database connections.

Summary Using the OleDB connection object. Using the OdbcConnection object. Using the connection pool. Using the transaction object.