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.

Slides:



Advertisements
Similar presentations
Database Basics. What is Access? Database management system Computer-based equivalent of a manual database Makes it easy to organize and update information.
Advertisements

Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
Internetteknologi (ITNET2) Presentation 21: ASP.NET Advanced.
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.
Chapter 9 Customizing Data with Web Controls. ASP.NET 2.0, Third Edition2.
Chapter 14.3 LINQ to SQL Programming in Visual Basic 2010: The Very Beginner’s Guide by Jim McKeown Databases – Part 3.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Building ASP.NET Applications 2 Lecture 3,4 T. Ahlam Algharasi 4 th Level.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Figure 1. Hit analysis in 2002 of database-driven web applications Hits by Category in 2002 N = 73,873 Results Reporting 27% GME 26% Research 20% Bed Availability.
1 ADVANCED MICROSOFT WORD Lesson 15 – Creating Forms and Working with Web Documents Microsoft Office 2003: Advanced.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
CSCI 6962: Server-side Design and Programming
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Chapter 10 Managing Data with ASP.NET. ASP.NET 2.0, Third Edition2.
Unit 8.2 Learning Objectives How data can be used – The Money Ball Example The Money Ball Example Data Warehouses – The Role of Data Warehouses The Role.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Navigating database with windows forms.. Tiered applications  Provide a means to develop many presentations of the same app  Makes changes to the back.
Creating a Web Site to Gather Data and Conduct Research.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
1 Web-Enabled Decision Support Systems Database Connectivity in Web Applications Don McLaughlin IE 423 (304) West.
Unit 8.3 Learning Objectives Insert users into the ASP.NET Membership system from code Capture data being sent to the database Capture Exceptions that.
Delivering Excellence in Software Engineering ® EPAM Systems. All rights reserved. Data Binding in ASP.NET.
Working with GridView Control: Adding Columns. Adding Buttons to a Bound GridView: 1. Drag the WebProduct table from Data connection to a page 2. Demo.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
1 Chapter 12 – Web Applications 12.1 Programming for the Web, Part I 12.2 Programming for the Web, Part II 12.3 Using Databases in Web Programs.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
1 CS 3870/CS 5870: Note 13 Lab 6 Authentication and Authorization Roles Management.
Chapter 8 Working With Databases in ASP.NET. Listing 8.1 – ShowListControls Uses The SqlDataSource control for estabishing database connectivity and.
1 CS 3870/CS 5870: Note 07 Lab 3 Lab 4 Test 1: Two Tables.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Access Project 7 Advanced Report and Form Techniques.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflows can be triggered by inputs that are designed to execute code, or alter the way the program.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
1 CS 3870/CS 5870: Note05 Prog3 Web Application with Database.
Data-Driven - 1 © Minder Chen, Building Data-Driven Web Sites in ASP.NET 2.0.
TRAINING SESSIONS.NET Controls.  Standard Controls  Label  Textbox  Checkbox  Button, Image Button, Image control  Radio Button  Literal  Hyperlink.
Reference: “ASP.NET 2.0 Illustrated” by Alex Homer and Dave Sussman. -ch3 illustrated book
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
CS 281 – Fall 2015 Lab 4 Parametric Query and Forms in MS Access.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflow Analysis of Buffer Overflow Attacks.
1 Database Design and Development: A Visual Approach © 2006 Prentice Hall Chapter 12 DATABASE DESIGN AND DEVELOPMENT: A VISUAL APPROACH Chapter 12 Accessing.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
1 CS387/CS587: Note04 Lab 3. 2 Master Page All Web pages will be similar Should be created before other web pages Add New Items Controls on the Master.
1.NET Web Forms Applications: Main Form © 2002 by Jerry Post.
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.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Chapter 5 Introduction To Form Builder. Lesson C Objectives  Use sequences to automatically generate primary key values in a form  Create lists of values.
Unit 8.2 Learning Objectives Data Warehouses – The Role of Data Warehouses The Role of Data Warehouses – Group Exercise Accessing Data in Views – Accessing.
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.
CS 281 – Fall 2010 Lab 4 Parametric Query and Forms in MS Access.
1. Prog3 Try and Catch Testing 2 Catching Database Errors Protected Sub DetailsView1_ItemDeleted( sender As Object, e As DetailsViewDeletedEventArgs)
Creating Data Base & Sql Data Source
Unit 9.1 Learning Objectives Data Access in Code
Unit 8.1: Introducing Databases
Web Application with Database
Incorporating Databases with ADO.NET
Unit 8.2 How data can be used Accessing Data in Views
Listing 9.1 ShowLocalConnection.aspx
Web Application with Dataase
test slide
Incorporating Databases with ADO.NET
Brief description on how to navigate within this presentation (ppt)
© 2016, Mike Murach & Associates, Inc.
Database Applications
Creating Data Base & Sql Data Source
Web Application with Dataase
Chapter 10 Accessing Database Files
Presentation transcript:

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 –For Prog 4 only 2

Main Master Page Head –Title: UWP – CS 3870/CS 5870 –ContentPlaceHolder with ID “head” –Link to CSS file Body –Form –Div –H1: Web Protocols... –H2: Names –ContentPlaceHolder with “ContentPlaceHolder1” 3

Prog4MasterPage No head or body or form –All are in MainMasterPage Content for “head” –What can be added here? –CSS file link Content for “ContentPlaceHolder1” –All controls should be within this Content –TreeView (not completed) –Add a new ContentPlaceHolder using ToolBox 4

Content Pages Add New Items –Web Form –Select Master Page –Place code in separate file –Default.aspx Add Web Form (with master) –Updating.aspx –Shopping.aspx 5

Content Pages Content for ContentPlaceHolder1 –All controls should be within this content control Cannot access ContentPlaceHolders in MainMasterPage directly 6

Prog4MasterPage Complete TreeView on Prog4MasterPage –Source view –Design view 7

8 TreeView Controls Navigation Tab Property Nodes (Collection) –Root Nodes –Child Nodes –Node Properties Text NagivateUrl

9 Accessing Database Data Source Controls –SqlDataSource –AccessDataSource –... Code class –Connection –Command –DataAdpater –AdapterBuilder Prog 3: Use Code class Prog 4: Use Data Source Controls

SqlDataSource Data Tab on ToolBox Smart Tag –Configure Data Source New Connection –Server Name: Xray\Sqlexpress –User SQL Server Authentication –User name: jim –Password: UWPCS3870 (case sensitive) –Select or enter a database name: UWPCS3870 (case sensitive) –OK Next 10

SqlDataSource Yes, save this connection as Specify columns from a table or view –Product –Where –Order By… –Advanced Generate Insert, Update and Delete statements: Check Use optimistic concurrency: Check Test Query Finish 11

Data Bound Controls Data Tag GridView FormView DetailsView DataList ListView... 12

Page Default Must use GridView Choose Data Source Must Format Fields 13

Format GridView AutoFormat –Your choice Edit Columns Select fields –Data Field –Header Text –ItemStyle Edit Templates 14

TemplateField Edit Columns UnitPrice Convert this field into a TemplateField OK Edit Templates –Select [Label] –Smart Tag –Edit Databindings –May need to Refresh Schema –Bound to: UnitPrice –Format: Currency – {0;C} Smart Tag End Template Editing 15

GridView Enable Paging: Yes Enable Sorting: Yes Enable Editing: No Enable Deleting: No Enable Selecting: No 16

Paging GridView Property Window Page size: 5 Page Settings –Mode: NextPreviousFirstLast –Text: Next, Previous, First, Last 17

Page Updating Any Data Bound Control One record at a time Navigate to all records Sorted by ProductID Update Delete New Message textbox 18

Paging DetailsView Property Window Page Settings –Mode: NextPreviousFirstLast –Text: Next, Previous, First, Last 19

Auto Format DetailsView 20

Catching Database Errors Protected Sub DetailsView1_ItemDeleted( sender As Object, e As DetailsViewDeletedEventArgs) Handles DetailsView1.ItemDeleted If Not e.Exception Is Nothing Then e.ExceptionHandled = True txtMessage.Text = e.Exception.Message End If End Sub Not DetailsView1.ItemDeleting! 21

Page Shopping Page must be the same as Prog3 –Textboxes for the fields –TextChange events SqlDataSource Binding textboxes to SqlDataSource? 22

Query with Parameters SqlDataSource Where –Column: ProductID –Operator: = –Source: None –Add [ProductID] Test Query 23

Execute Query ‘ Get the ID id = txtID.Text.Trim ‘ Set query parameter SqlDataSource1.SelectParameters("ProductID").DefaultVa lue = id ‘ Get the query result, which is a DataView Dim dv As System.Data.DataView = CType(SqlDataSource1.Select( DataSourceSelectArguments.Empty), System.Data.DataView) 24

Execute Query ‘ Get the ID ‘ Set query parameter ‘ Get the query result, which is a DataView If dv.Count = 1 Then ‘ Valid ID price = dv.Item(0)(2)... Else ‘ Invalid ID End If 25

Prog 4 Bonus Points Use one SqlDataSource for all pages. 26

Test 1 Thursday, October 9 27