Download presentation
Presentation is loading. Please wait.
1
Current Popular IT I Pertemuan 5
Matakuliah : T0403/Current Popular IT I Tahun : 2008 Current Popular IT I Pertemuan 5
2
Learning Outcomes Learner can use SQL database
Learner can use databound controls Learner can use data access layer Copyright © Surya Sujarwo 2008 Bina Nusantara
3
Material Outline Using SQL Server Express Database
Overview of Data Access Controls using datasource Data model choices Configuring Providers SQL Provider Databound controls Manual Data Access Layer Generated Data Access Layer Business Logic Layer Copyright © Surya Sujarwo 2008 Bina Nusantara
4
Using SQL Server Express Database
Adding a database to the project In Solution Explorer, right-click the App_Data folder, and then click Add New Item. In the Add New Item window, select SQL Database. Change the name of the database and then click Add. Click Yes to place the database in the App_Data folder if asked. References: ASP.NET 3.5 For DUMMIES(Ken Cox, 2008) Bina Nusantara
5
Using SQL Server Express Database
Adding a table to the database Open menu: View -> Database Explorer Right click in the table node, choose add net table Entry column name, and choose data type In the Column properties of Id choose (Is Identity) Yes Save it to a name (Employee for example) References: ASP.NET 3.5 For DUMMIES(Ken Cox, 2008) Bina Nusantara
6
Using SQL Server Express Database
Adding data to the table Right click in the table Choose show table data Entry the data References: ASP.NET 3.5 For DUMMIES(Ken Cox, 2008) Bina Nusantara
7
Overview of Data Access
Any application will need to involve data like show, edit or delete. In ASP.NET this can be done by: Using databound controls: List Controls: BulletedList, CheckBoxList, DropDownList, ListBox, RadioButtonList Tabular DataBound Controls: GridView, DataList, Repeater, ListView, DetailsView, FormView Hierarchical DataBound Controls: Menu, TreeView Using datasource controls SqlDataSource LinqDataSource AccessDataSource ObjectDataSource XmlDataSource SiteMapDataSource Programmatically do the databinding References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008) Bina Nusantara
8
Controls Using Datasource
List Controls References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008) Bina Nusantara
9
Controls Using Datasource(Continue…)
List Controls (continue…) References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008) Bina Nusantara
10
Data model choices ASP.NET Data model choices: Typed DataSet
NonTyped DataSet DataReaders References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
11
Data model choices (Continue…)
Typed DataSet References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
12
Data model choices (Continue…)
Nontyped DataSet DataReaders References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
13
Configuring Providers
In Web.config: References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
14
SQL Provider SQL Provider: SqlMembershipProvider (manages users)
For Controls: Login, LoginView, LoginStatus, LoginName, PasswordRecovery, CreateUserWizard, ChangePassword SqlRoleProvider (group users) SqlProfileProvider (provide additional properties to a user account) References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
15
Databound controls DetailsView
References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
16
Databound controls (Continue…)
FormView In Web Config: References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
17
Databound controls (Continue…)
FormView (continue…) References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
18
Databound controls (Continue…)
FormView (continue…) References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
19
Databound controls (Continue…)
FormView (continue…) References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
20
Databound controls (Continue…)
GridView References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
21
Databound controls (Continue…)
GridView (continue…) References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
22
Manual Data Access Layer
DataObjects and ObjectDataSource Steps: Creating the Class Library Creating the Data Access Methods (select,update,insert,delete) Handling Exceptions Creating Business Objects (e.g Employee with name, position, join_date) References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
23
Manual Data Access Layer
References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
24
Generated Data Access Layer
References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
25
Generated Data Access Layer (Continue…)
References: Pro ASP.NET for SQL Server (Brennan Stehling, 2007) Bina Nusantara
26
Business Logic Layer Business Logic Layer example:
References: Bina Nusantara
27
That’s All Thank You for the Attention
Bina Nusantara
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.