1.NET Web Forms Applications: Main Form © 2002 by Jerry Post.

Slides:



Advertisements
Similar presentations
Microsoft® Access® 2010 Training
Advertisements

Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
A complete citation, notecard, and outlining tool
1.NET Web Forms DataGrid © 2002 by Jerry Post. 2 Data Grid Has Many Uses  The grid uses HTML tables to display multiple rows of data. It is flexible.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Conference Calendar CS 337 Project Supervised by Professor Russell Abbott. Alexandre Lomovtsev, Haritha Sankavaram, Lewis Chen, Rasha Mohamed.
ASP.NET Database Connectivity I. 2 © UW Business School, University of Washington 2004 Outline Database Concepts SQL ASP.NET Database Connectivity.
End and Start of Year Administration Tasks. Account Administration Deleting Accounts Creating a Leavers Group Creating New Accounts: Creating accounts.
Project Implementation for COSC 5050 Distributed Database Applications Lab6.
Scottish Legal Aid Board Content Management using OpenCms Martin Spinks CTO Navyblue Tuesday, March 16, 2010.
Microsoft Access Intro Class 1 Database Concepts.
1.NET Web Forms ADO.NET Introduction © 2002 by Jerry Post.
DAY 15: ACCESS CHAPTER 2 Larry Reaves October 7,
6 th Annual Focus Users’ Conference 6 th Annual Focus Users’ Conference Curriculum Guides Presented by: Kori Watkins Presented by: Kori Watkins.
Air Quality System Precision and Accuracy Data Transaction Generator (AQSP&A) Training Session.
1 MySQL and phpMyAdmin. 2 Navigate to and log on (username: pmadmin)
ArchForum Presentation The first multilingual, multimedia archeological web forum.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
A fill-in-the-blank tool that guides you through picking a topic, searching the Internet, gathering good Internet links, and turning them into online learning.
©2006, CSA Creating and Managing Your COS Expertise Profile Managing Your CV and Promoting Your Work ® Resources for Research, Worldwide.
Navigating database with windows forms.. Tiered applications  Provide a means to develop many presentations of the same app  Makes changes to the back.
© 2003 By Default! A Free sample background from Slide 1 Week 2  Free PHP Hosting Setup  PHP Backend  Backend Security 
Singapore Primary Schools Sports Council User Guide.
Millennium Cataloging Rich Edwards Program Manager, Technical Services Washington State Library.
Mark Dixon 1 22 – Web applications: Writing data to Databases using ASP.Net.
PHP meets MySQL.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester November 2011.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
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.
1.NET Web Forms Business Forms © 2002 by Jerry Post.
Singapore Schools Sports Council User Guide. Table of Contents How To Login How To Logout How To Add Games Content (Same for ASG) How To Edit Games Content.
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 07 Lab 3 Lab 4 Test 1: Two Tables.
6c – Function Procedures Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Microsoft Access 2013 ®® Tutorial 12 Managing and Securing a Database.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Using LastPass. Great password management is impossible w/o a great tool Auto-fill (hands-free login) will save you approximately one hour per month You.
PowerPoint Basics Basics Add lyrics Add picturespictures hyperlinks Create an index Custom animation animation Add musicmusic PowerPoint PowerPoint Templates.
1 All Powder Board and Ski Microsoft Access Workbook Chapter 9: Database Administration Jerry Post Copyright © 2003.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
Lesson 4.  After a table has been created, you may need to modify it. You can make many changes to a table—or other database object—using its property.
 Empowers to your customer  Product Rating and its Management in Ecommerce Framework  Product Reviews and Management: Collecting customer opinion about.
NIMAC for Publishers: How to Create Sub User Accounts December 2015.
1.NET Web Forms ADO.NET Structure © 2002 by Jerry Post.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
Getting Started. Package Overview (GradeQuick)‏ Web-based grade book –Access Anywhere –Always Current Paper grade book “look and feel” Flexible grading.
Leading firms through the next generation of change™
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 1: Introduction to IS2803 Rob Gleasure
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Using ADO.Net to Build a Login System Dr. Ron Eaglin.
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.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
PLACING ORDERS- SHOPPPING CARTS. Introduction There are several stages to the order process, starting with an order page, which allows customers to add.
Access Test Questions Test Date: 05/05/16. Chapter 1 (Lynda.com) Question 1 An access database uses five main components (database objects). Which is.
NIMAC for Accessible Media Producers: February 2013 NIMAC 2.0 for AMPs.
Acess Test Questions. Chapter 1 (Lynda.com) Question 1 An access database uses five main components (database objects). Which is not one of them? Tables.
Unit 7 Learning Objectives
Oracle Application Express (APEX)
Unit 8.2 How data can be used Accessing Data in Views
Bulk update E. Camelback Road #559, Phoenix, AZ Phone: Fax:
Core LIMS Training: Advanced Administration
How to Use Members Area of The Ninety-Nines Website
HP ALM Defects Module To protect the confidential and proprietary information included in this material, it may not be disclosed or provided to any third.
Introduction to the ISB Intranet
TPC-Global PARTcommunity
Access Test Questions Test Date: 05/05/16.
Grauer and Barber Series Microsoft Access Chapter One
Presentation transcript:

1.NET Web Forms Applications: Main Form © 2002 by Jerry Post

2 Student Edit Form

3 Development Options  Single-row main forms are generally highly customized for a specific application. So, it is often easiest to build each form from scratch; following the general principles already discussed.  However, it is sometimes easier to use a template approach for data-driven main forms.  The examples presented here are based on the CareerSystem database, which uses a slightly different approach to updates. It creates all of the SQL statements internally, and ignores concurrency. The main focus is on performance, and it is much faster, and scalable to not use datasets. If you need a form with concurrency, simply follow the earlier discussions on using datasets.

4 Database Component  Create the data adapters and data sets for the main form and any drop down lists.  Define a variable to hold the original select command (The template requires this, but it is easy to eliminate it.): Private strSel[Table Name] As String  In the Sub New(), add a line to save the select command strSel[Table Name] = Me.adp[Table Name].SelectCommand.CommandText  Add the routine: Set[Table Name]Select  Add the Fill routines for the data adapters.  Add the Update routine for the main data adapter.  Rewrite the ValidateStudent function (or delete it)  Globally replace [Table Name] and [Primary Key]  Paste in the standard generic code routines.  Component template (rtf format) Component template (rtf format)

5 Main Form  You can copy and edit the template, or drag-and-drop your own labels and data controls.edit the template  Be sure to include buttons for Add, Save, Delete (and probably Find), as well as the invisible lblIsNew.  Add the TMF.vb file to your project if it is not already there.  Be sure to set the default values for the DDLs (a) DataBindings, Selected Index, Custom (b) tmf.SelectDefaultDDL(sender, [DataSet LookUp1], DataBinder.Eval([DataSet1], "Tables[[Table Name]].DefaultView.[0].[Foreign Key]")) (c) [DataSet LookUp1]DsDegreeList1--the dataset with the lookup data [DataSet1]DsStudent1--the primary dataset [Table Name]Student--primary dataset table name [Foreign Key]DegreeID--foreign key column in the primary table

6 Main Form Code (a) Protected tmf As New TMF() (b) Private aryColumns() As tmf.singleEditItem = {..... } Add each col: Name, Edit ID, control type (Text, DDL, Check, Label), primary key (c) Page_Load Might need more rewrite, and you might want to put datasets into Session variables. Check the security conditions. Replace [Primary Key]StudentID [Primary Key DataType]String [Table Name]Student [DataSet Name1]DsStudent1 [DataSet Name]DsStudent [Search Column]LastNameprimary column to use in Find (d) Rewrite or Delete CheckAdmin, which is a secondary security test (e) Rewrite BindFormData, note that the SQL statement assumes the primary key is a string Make other changes indicated by the [Edit me] flags

7 Main Form Button Code (f) btnSave_Click: Decide if you need to encrypt any columns Decide if you want the additional security test Decide if you need to generate a new key value for Add Decide if you want secondary security test on User Level after insert. Replace [Table Name] (g) btnNew_Click No changes needed (h) btnDelete_Click Decide if you need additional security test Choose main sort columns (txtLastName, txtFirstName) Replace [Table Name] and [Primary Key]

8 Application  Security .NET actually has some strong integrated security, but you never want to create machine accounts for external users.  Login  Usually better to create a username and password and store in a table.  Then have users login at the start, and store a login ID in a session variable.  Then each page tests the session variable.  Multiple use forms  You can use the login ID to customize the options on forms by making some controls visible or invisible.  Navigation  Across the application: You at least need a main form and a link back the main form on each page.  Within a given topic. You could add Next/Previous buttons on a form, but they would be slow across the Internet. Better to create a list with limited information and a search routine, and let users click to get to the main edit form.

9 Security: Login Button Code Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click Dim cmpMain As New DBMain(), cmpStu As New DBStudent() Dim strUser As New StringBuilder() Session.RemoveAll() ' To be safe, clear out any prior session Session.Clear() Dim usr As New UserData() ' First see if user is a valid employee usr = cmpMain.ValidateEmployee(strUser.ToString.Trim, txtPassword.Text.Trim) ' If not, see if user is a valid student If (usr Is Nothing) Then usr = cmpStu.ValidateStudent(strUser.ToString.Trim, txtPassword.Text.Trim) End If This version uses a class/structure to hold more data about the user that might be needed in some forms. Often you can get by with just the name.

10 Security: Login Button Code 2 If (usr Is Nothing) Then ' Not a valid login anywhere lblUser.Text = "Invalid Username/Password" Session("IsValidLogin") = False SetVisibleLogin(True) Else lblUser.Text = usr.UserLevel & ": " & usr.FirstName & " " & usr.LastName Session("IsValidLogin") = True Session("User") = usr SetVisibleLogin(False) End If End Sub

11 Security Test on Page Page_Load or Page_Init If (Not CType(Session("IsValidLogin"), Boolean)) Then Session("Message") = "Please log in." Server.Transfer("StartTest.aspx") End If CheckAdmin() ' And turn on some edit items only for administrators