SlideShare a Scribd company logo
Slide 1 of 7Ver. 1.0
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
Slide 2 of 7Ver. 1.0
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
Slide 3 of 7Ver. 1.0
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.)
Slide 4 of 7Ver. 1.0
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.)
Slide 5 of 7Ver. 1.0
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.)
Slide 6 of 7Ver. 1.0
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.)
Slide 7 of 7Ver. 1.0
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

Chapter 13
Chapter 13Chapter 13
Chapter 23
Chapter 23Chapter 23
Chapter 26
Chapter 26Chapter 26
Chapter 25
Chapter 25Chapter 25
Chapter 16
Chapter 16Chapter 16
Data controls ppt
Data controls pptData controls ppt
Data controls ppt
Iblesoft
 

Viewers also liked (6)

Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Chapter 23
Chapter 23Chapter 23
Chapter 23
 
Chapter 26
Chapter 26Chapter 26
Chapter 26
 
Chapter 25
Chapter 25Chapter 25
Chapter 25
 
Chapter 16
Chapter 16Chapter 16
Chapter 16
 
Data controls ppt
Data controls pptData controls ppt
Data controls ppt
 

Similar to 07 asp.net session10

06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
Mani Chaubey
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
Vivek chan
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
Niit Care
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
Bhavin Shah
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
Akhil Mittal
 
CAD Report
CAD ReportCAD Report
CAD Report
Jyoti Tyagi
 
Scaffolding
ScaffoldingScaffolding
Scaffolding
DrMohamed Oaf
 
Mvc summary
Mvc summaryMvc summary
Mvc summary
Muhammad Younis
 
Work with data in ASP.NET
Work with data in ASP.NETWork with data in ASP.NET
Work with data in ASP.NET
Peter Gfader
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
Giovanni Javier Jimenez Cadena
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
Vivek chan
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
Julie Iskander
 
Develop Mobile App Using Android Lollipop
Develop Mobile App Using Android LollipopDevelop Mobile App Using Android Lollipop
Develop Mobile App Using Android Lollipop
Edureka!
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
Vivek chan
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
Vivek chan
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjs
Erhwen Kuo
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Sparkhound Inc.
 
Google cloud Professional Data Engineer practice exam test 2020
Google cloud Professional Data Engineer practice exam test 2020Google cloud Professional Data Engineer practice exam test 2020
Google cloud Professional Data Engineer practice exam test 2020
SkillCertProExams
 
Grid Vew Control VB
Grid Vew Control VBGrid Vew Control VB
Grid Vew Control VB
sunmitraeducation
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
WebStackAcademy
 

Similar to 07 asp.net session10 (20)

06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
06 asp.net session08
06 asp.net session0806 asp.net session08
06 asp.net session08
 
MVC ppt presentation
MVC ppt presentationMVC ppt presentation
MVC ppt presentation
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
CAD Report
CAD ReportCAD Report
CAD Report
 
Scaffolding
ScaffoldingScaffolding
Scaffolding
 
Mvc summary
Mvc summaryMvc summary
Mvc summary
 
Work with data in ASP.NET
Work with data in ASP.NETWork with data in ASP.NET
Work with data in ASP.NET
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
 
ASP.NET Lecture 4
ASP.NET Lecture 4ASP.NET Lecture 4
ASP.NET Lecture 4
 
Develop Mobile App Using Android Lollipop
Develop Mobile App Using Android LollipopDevelop Mobile App Using Android Lollipop
Develop Mobile App Using Android Lollipop
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
01 startoff angularjs
01 startoff angularjs01 startoff angularjs
01 startoff angularjs
 
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
Optimizing Code Reusability for SharePoint using Linq to SharePoint & the MVP...
 
Google cloud Professional Data Engineer practice exam test 2020
Google cloud Professional Data Engineer practice exam test 2020Google cloud Professional Data Engineer practice exam test 2020
Google cloud Professional Data Engineer practice exam test 2020
 
Grid Vew Control VB
Grid Vew Control VBGrid Vew Control VB
Grid Vew Control VB
 
Angular - Chapter 4 - Data and Event Handling
 Angular - Chapter 4 - Data and Event Handling Angular - Chapter 4 - Data and Event Handling
Angular - Chapter 4 - Data and Event Handling
 

More from Mani Chaubey

08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
Mani Chaubey
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
Mani Chaubey
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
Mani Chaubey
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
Mani Chaubey
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
Mani Chaubey
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
Mani Chaubey
 

More from Mani Chaubey (6)

08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
 
04 asp.net session05
04 asp.net session0504 asp.net session05
04 asp.net session05
 
03 asp.net session04
03 asp.net session0403 asp.net session04
03 asp.net session04
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
 

07 asp.net session10

  • 1. Slide 1 of 7Ver. 1.0 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. Slide 2 of 7Ver. 1.0 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. Slide 3 of 7Ver. 1.0 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. Slide 4 of 7Ver. 1.0 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. Slide 5 of 7Ver. 1.0 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. Slide 6 of 7Ver. 1.0 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. Slide 7 of 7Ver. 1.0 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.)