SlideShare a Scribd company logo
Developing Web Applications Using ASP.NET
In this session, you will learn to:
Create and retrieve database connections by using the
Web.Config file
Access relational data by using the SqlDataSource control and
data controls
Access XML data by using the XmlDataSource control and
data controls
Access objects as data by using the ObjectDataSource control
and data controls
Objectives
Developing Web Applications Using ASP.NET
Problem Statement:
You are a developer in the Adventure Works organization, a
fictitious bicycle manufacturer. You have been asked to assist
in the development of the Business-to-Consumer (B2C) Web
application and a related Business-to-Employee (B2E) extranet
portal.
Decisions on the design of the application have already been
made. You have been asked to carry out a number of specific
tasks in order to implement various elements of this design.
Demo: Accessing and Displaying Data
Developing Web Applications Using ASP.NET
As part of the first phase of the B2C development, you have
been asked to implement prototypes of pages that display and
manipulate data from the AdventureWorks database.You have
also been asked to implement prototypes of pages that display
and manipulate data from custom object data sources and
XML data from the TrailReport Web service.
Demo: Accessing and Displaying Data (Contd.)
Developing Web Applications Using ASP.NET
Solution:
To solve this problem, you need to perform following tasks:
1. Create and Retrieve Database Connections
a. Add a connection string for the AdventureWorks database to the
Web.Config file.
b. Programmatically retrieve the connection to the AdventureWorks
database.
c. Programmatically open the connection and verify that it is open.
d. Test the database connectivity.
Demo: Accessing and Displaying Data (Contd.)
Developing Web Applications Using ASP.NET
2. Access Data by Using SqlDataSource Controls and Data Controls
a. Add a SqlDataSource control to the Products page.
b. Set connection properties for the SqlDataSource control.
c. Bind a DropDownList control to the SqlDataSource control.
d. Add and configure a Subcategories GridView control with an associated
SqlDataSource control.
e. Define the columns for the gvwSubcategories control.
f. Add and configure a Products GridView control and associated
SqlDataSource control.
g. Define columns and templates for the gvwProduct GridView control.
h. Add and configure a Product Details DetailsView control and associated
SqlDataSource control.
i. Add a DataList control to the ProductDetails.aspx page.
j. Add an SqlDataSourceControl to the page.
k. Run and test the Web application.
Demo: Accessing and Displaying Data (Contd.)
Developing Web Applications Using ASP.NET
3. Access Objects as Data with ObjectDataSource Controls
a. Review the data-access code in the business object.
b. Configure an ObjectDataSource control for business-data access.
c. Add and configure a FormView control.
d. Define the EmptyDataTemplate element for the FormView control.
e. Define the ItemTemplate element for the FormView control.
f. Define the InsertItemTemplate element for the FormView control.
g. Add code to the Inserting event of the FormView control.
h. Run and test the Web application.
Demo: Accessing and Displaying Data (Contd.)
Developing Web Applications Using ASP.NET
4. Access XML Data by Using XmlDataSource Controls
a. Add an XmlDataSource object to the TrailReport.aspx page.
b. Add and configure a TreeView control for the TrailReport.aspx page.
c. Add code to an event procedure for the TreeView control.
d. Add code for the Page_Load event of the TrailReport.aspx page.
e. Test the XML data handling of the Web application.
Demo: Accessing and Displaying Data (Contd.)

More Related Content

Viewers also liked (17)

PPSX
CyberLab Work-EX Program
Vivek Singh Chandel
 
PPSX
04 intel v_tune_session_05
Vivek Singh Chandel
 
PPSX
CyberLab Training Division
Vivek Singh Chandel
 
PPSX
10 asp.net session14
Vivek Singh Chandel
 
PPSX
CyberLab Development Division
Vivek Singh Chandel
 
PPSX
01 asp.net session01
Vivek Singh Chandel
 
PPSX
11 asp.net session16
Vivek Singh Chandel
 
PPSX
01 intel v_tune_session_01
Vivek Singh Chandel
 
PPSX
09 asp.net session13
Vivek Singh Chandel
 
PPSX
Net framework session03
Vivek Singh Chandel
 
PPSX
02 asp.net session02
Vivek Singh Chandel
 
PPSX
13 asp.net session19
Vivek Singh Chandel
 
PPSX
CyberLab Vehicle Tracking System
Vivek Singh Chandel
 
PPSX
03 intel v_tune_session_04
Vivek Singh Chandel
 
PPSX
What is Robotics - Robotics Concept Explained for Kids
Vivek Singh Chandel
 
PDF
Self driving and connected cars fooling sensors and tracking drivers
Vivek Singh Chandel
 
PPSX
Complete Osi Model Explained
Vivek Singh Chandel
 
CyberLab Work-EX Program
Vivek Singh Chandel
 
04 intel v_tune_session_05
Vivek Singh Chandel
 
CyberLab Training Division
Vivek Singh Chandel
 
10 asp.net session14
Vivek Singh Chandel
 
CyberLab Development Division
Vivek Singh Chandel
 
01 asp.net session01
Vivek Singh Chandel
 
11 asp.net session16
Vivek Singh Chandel
 
01 intel v_tune_session_01
Vivek Singh Chandel
 
09 asp.net session13
Vivek Singh Chandel
 
Net framework session03
Vivek Singh Chandel
 
02 asp.net session02
Vivek Singh Chandel
 
13 asp.net session19
Vivek Singh Chandel
 
CyberLab Vehicle Tracking System
Vivek Singh Chandel
 
03 intel v_tune_session_04
Vivek Singh Chandel
 
What is Robotics - Robotics Concept Explained for Kids
Vivek Singh Chandel
 
Self driving and connected cars fooling sensors and tracking drivers
Vivek Singh Chandel
 
Complete Osi Model Explained
Vivek Singh Chandel
 

Similar to 07 asp.net session10 (20)

PPSX
06 asp.net session08
Vivek Singh Chandel
 
PPS
06 asp.net session08
Mani Chaubey
 
PPTX
Ch 7 data binding
Madhuri Kavade
 
PPS
06 asp.net session08
Niit Care
 
PPTX
ASP.NET Lecture 4
Julie Iskander
 
DOCX
unit 3.docx
Sadhana Sreekanth
 
PDF
Asp.net
Rizwan Ahmed
 
PPT
Asp db
teach4uin
 
PPSX
16 asp.net session23
Vivek Singh Chandel
 
DOC
java Developing using asp.net
Tanay Kishore Mishra
 
PDF
Ado Fundamentals
asim78
 
PDF
Database Programming With Visual Basic Net And Adonet Tips Tutorials And Code...
keeverfelmor
 
PDF
Asp net interview_questions
Ghazi Anwar
 
PDF
Asp net interview_questions
Bilam
 
PPTX
Chapter 15
application developer
 
PPT
Chapter12 (1)
Rajalaxmi Pattanaik
 
PDF
Asp.net
KIRTI PRADHAN
 
PDF
Asp.net brochure
Zabeel Institute
 
06 asp.net session08
Vivek Singh Chandel
 
06 asp.net session08
Mani Chaubey
 
Ch 7 data binding
Madhuri Kavade
 
06 asp.net session08
Niit Care
 
ASP.NET Lecture 4
Julie Iskander
 
unit 3.docx
Sadhana Sreekanth
 
Asp.net
Rizwan Ahmed
 
Asp db
teach4uin
 
16 asp.net session23
Vivek Singh Chandel
 
java Developing using asp.net
Tanay Kishore Mishra
 
Ado Fundamentals
asim78
 
Database Programming With Visual Basic Net And Adonet Tips Tutorials And Code...
keeverfelmor
 
Asp net interview_questions
Ghazi Anwar
 
Asp net interview_questions
Bilam
 
Chapter12 (1)
Rajalaxmi Pattanaik
 
Asp.net
KIRTI PRADHAN
 
Asp.net brochure
Zabeel Institute
 
Ad

More from Vivek Singh Chandel (17)

PDF
Deceptive Marketing.pdf
Vivek Singh Chandel
 
PDF
brain controled wheel chair.pdf
Vivek Singh Chandel
 
PDF
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Vivek Singh Chandel
 
PDF
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Vivek Singh Chandel
 
PDF
EEG Acquisition Device to Control Wheelchair Using Thoughts
Vivek Singh Chandel
 
PDF
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Vivek Singh Chandel
 
PPSX
Net framework session01
Vivek Singh Chandel
 
PPSX
Net framework session02
Vivek Singh Chandel
 
PPSX
02 intel v_tune_session_02
Vivek Singh Chandel
 
PPSX
09 intel v_tune_session_13
Vivek Singh Chandel
 
PPSX
07 intel v_tune_session_10
Vivek Singh Chandel
 
PPSX
15 asp.net session22
Vivek Singh Chandel
 
PPSX
14 asp.net session20
Vivek Singh Chandel
 
PPSX
12 asp.net session17
Vivek Singh Chandel
 
PPSX
08 asp.net session11
Vivek Singh Chandel
 
PPSX
05 asp.net session07
Vivek Singh Chandel
 
PPSX
04 asp.net session05
Vivek Singh Chandel
 
Deceptive Marketing.pdf
Vivek Singh Chandel
 
brain controled wheel chair.pdf
Vivek Singh Chandel
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Vivek Singh Chandel
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Vivek Singh Chandel
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
Vivek Singh Chandel
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Vivek Singh Chandel
 
Net framework session01
Vivek Singh Chandel
 
Net framework session02
Vivek Singh Chandel
 
02 intel v_tune_session_02
Vivek Singh Chandel
 
09 intel v_tune_session_13
Vivek Singh Chandel
 
07 intel v_tune_session_10
Vivek Singh Chandel
 
15 asp.net session22
Vivek Singh Chandel
 
14 asp.net session20
Vivek Singh Chandel
 
12 asp.net session17
Vivek Singh Chandel
 
08 asp.net session11
Vivek Singh Chandel
 
05 asp.net session07
Vivek Singh Chandel
 
04 asp.net session05
Vivek Singh Chandel
 
Ad

Recently uploaded (20)

PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
PPTX
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
PDF
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Zoology (Animal Physiology) practical Manual
raviralanaresh2
 
Gall bladder, Small intestine and Large intestine.pptx
rekhapositivity
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
How to Configure Prepayments in Odoo 18 Sales
Celine George
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
How to Configure Access Rights of Manufacturing Orders in Odoo 18 Manufacturing
Celine George
 
IMP NAAC REFORMS 2024 - 10 Attributes.pdf
BHARTIWADEKAR
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 

07 asp.net session10

  • 1. Developing Web Applications Using ASP.NET In this session, you will learn to: Create and retrieve database connections by using the Web.Config file Access relational data by using the SqlDataSource control and data controls Access XML data by using the XmlDataSource control and data controls Access objects as data by using the ObjectDataSource control and data controls Objectives
  • 2. Developing Web Applications Using ASP.NET Problem Statement: You are a developer in the Adventure Works organization, a fictitious bicycle manufacturer. You have been asked to assist in the development of the Business-to-Consumer (B2C) Web application and a related Business-to-Employee (B2E) extranet portal. Decisions on the design of the application have already been made. You have been asked to carry out a number of specific tasks in order to implement various elements of this design. Demo: Accessing and Displaying Data
  • 3. Developing Web Applications Using ASP.NET As part of the first phase of the B2C development, you have been asked to implement prototypes of pages that display and manipulate data from the AdventureWorks database.You have also been asked to implement prototypes of pages that display and manipulate data from custom object data sources and XML data from the TrailReport Web service. Demo: Accessing and Displaying Data (Contd.)
  • 4. Developing Web Applications Using ASP.NET Solution: To solve this problem, you need to perform following tasks: 1. Create and Retrieve Database Connections a. Add a connection string for the AdventureWorks database to the Web.Config file. b. Programmatically retrieve the connection to the AdventureWorks database. c. Programmatically open the connection and verify that it is open. d. Test the database connectivity. Demo: Accessing and Displaying Data (Contd.)
  • 5. Developing Web Applications Using ASP.NET 2. Access Data by Using SqlDataSource Controls and Data Controls a. Add a SqlDataSource control to the Products page. b. Set connection properties for the SqlDataSource control. c. Bind a DropDownList control to the SqlDataSource control. d. Add and configure a Subcategories GridView control with an associated SqlDataSource control. e. Define the columns for the gvwSubcategories control. f. Add and configure a Products GridView control and associated SqlDataSource control. g. Define columns and templates for the gvwProduct GridView control. h. Add and configure a Product Details DetailsView control and associated SqlDataSource control. i. Add a DataList control to the ProductDetails.aspx page. j. Add an SqlDataSourceControl to the page. k. Run and test the Web application. Demo: Accessing and Displaying Data (Contd.)
  • 6. Developing Web Applications Using ASP.NET 3. Access Objects as Data with ObjectDataSource Controls a. Review the data-access code in the business object. b. Configure an ObjectDataSource control for business-data access. c. Add and configure a FormView control. d. Define the EmptyDataTemplate element for the FormView control. e. Define the ItemTemplate element for the FormView control. f. Define the InsertItemTemplate element for the FormView control. g. Add code to the Inserting event of the FormView control. h. Run and test the Web application. Demo: Accessing and Displaying Data (Contd.)
  • 7. Developing Web Applications Using ASP.NET 4. Access XML Data by Using XmlDataSource Controls a. Add an XmlDataSource object to the TrailReport.aspx page. b. Add and configure a TreeView control for the TrailReport.aspx page. c. Add code to an event procedure for the TreeView control. d. Add code for the Page_Load event of the TrailReport.aspx page. e. Test the XML data handling of the Web application. Demo: Accessing and Displaying Data (Contd.)