Session 4 From Access Forms to Windows Forms.NET Adam Cogan Database Architect ssw.com.au.

Slides:



Advertisements
Similar presentations
Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Advertisements

Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Advantage Data Dictionary. agenda Creating and Managing Data Dictionaries –Tables, Indexes, Fields, and Triggers –Defining Referential Integrity –Defining.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Create Windows ® Applications with.NET Allan Knudsen.NET Developer Evangelist Microsoft.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Creating a SharePoint App with Microsoft Access Services
Migrating Access Applications to.NET and SQL Server Ken Tim
Enterprise Reporting with Reporting Services SQL Server 2005 Donald Farmer Group Program Manager Microsoft Corporation.
Pasewark & Pasewark Microsoft Office XP: Introductory Course 1 INTRODUCTORY MICROSOFT ACCESS Lesson 3 – Creating and Modifying Forms.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
MS Access Advanced Instructor: Vicki Weidler Assistant:
Some Basic Database Terminology
Overview of Microsoft.Net and Vb.Net ITSE 2349 Spring 2002 Material from Microsoft.Net an Overview for ACC faculty by Stuart Laughton and Introduction.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Session 3 Access to Reporting Services Adam Cogan Database Architect ssw.com.au.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Extreme Programming Adam Cogan Database Architect ssw.com.au.
10/26/00Splitting Access Databases...1 Preparing for Access 2000 Windows 2000/Office 2000 Roll-out.
Introduction to .Net Framework
ASP.NET INTRODUCTION INTO وزارة التربية و التعليم العالي كلية العلوم و التكنولوجيا قسم علوم الحاسوب و تكنولوجيا المعلومات اعداد الاستاذ: عبد الله محمد.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
.NET Framework & C#.
Microsoft Visual Basic 2005: Reloaded Second Edition
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 12 1 Microsoft Office Access 2003 Tutorial 12 – Managing and Securing a Database.
Obsydian OLE Automation Ranjit Sahota Chief Architect Obsydian Development Ranjit Sahota Chief Architect Obsydian Development.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
Converting Access 97 to 2003 Adam Cogan Database Architect ssw.com.au.
Rules to Healthier Code Presented by Adam Cogan (Chief Architect for
Create Windows ® Applications with.NET Carlotta Eaton ( Associate Professor of IST New River Community College Slides by Microsoft.
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Windows Forms Navigating database with windows forms.
Access Forms and Queries. Entering Data in Your Table  You can add data to your table in Datasheet view, by typing in the columns and rows.  This.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Visual Basic for Application - Microsoft Access 2003 Finishing the application.
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.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 350.
ASP.net Course From Intermediate to Advance level By Arsalan Ahmed 3 Months Course Cell :
Building Enterprise Applications Using Visual Studio®
Visual Studio Tools for Office 2005
Microsoft Office Illustrated
Microsoft Access Illustrated
Using Procedures and Exception Handling
Module 1: Getting Started
Database Applications
Web Development Using ASP .NET
Chapter 10 Accessing Database Files
Windows Forms in Visual Studio 2005: An in-depth look at key features
Mark Quirk Head of Technology Developer & Platform Group
Presentation transcript:

Session 4 From Access Forms to Windows Forms.NET Adam Cogan Database Architect ssw.com.au

About Adam Chief Architect for - experience with: –internal corporate development and –generic off-the-shelf databases –Clients: Enterasys Networks, Cisco, Microsoft… Run Teams of Developers President.NET User Group, Sydney Speaker for Microsoft Roadshows, Dev Conn, VSLive Microsoft Regional Director, Australia New World

To From

Overview Access 97 to Access 2003 Accessto SQL Server AccesstoReportingServices AccesstoWindows Forms.NET 1234

Agenda Current Problems What’s New in.NET Lab: Migrating from Access Forms to Windows Forms.NET Breezers Drink Receipt From Outback OzOutback Oz

Assumptions Backend in SQL Server 2000 Using Enterprise Manager for data management Access forms front-end Reports using Reporting Services Some VBA knowledge

Session Prerequisites (Current Problems) 1. 1.“Our application stopped working on Mary’s machine when we installed the new version of Office” 2. 2.“Our Access database got corrupted and we can’t open it” 3. 3.“Our Access forms run too slowly - we want a small, fast EXE” 4. 4.“Can we stop the continual polling of SQL Server so we can scale this application?” 5. 5.“We want to integrate with other systems”

Enter.NET No need for Access runtime or Office for end-user (1) Produce an EXE which doesn’t get corrupted like an MDB (2) The EXE is small and runs fast (3) Only explicit updates to database (4) Web Service Support are built in (use an open XML-based architecture) (5)

Problems with Bound Access Forms Advantage – Database Connections are Controllable In Access Forms perform database queries in the background Cannot be controlled In.NET Full control over database connections and queries Improved performance and scalability Not as smooth a ridesmooth a ride

Problems with Bound Access Forms Advantage – Database Connections are Controllable In Access In.NET

Differences In Form Design Advantage – A Shallow Learning Curve for Access Developers (1 of 2)

Differences In Form Design Advantage – A Shallow Learning Curve for Access Developers (2 of 2)

Northwind.NET

Differences In Form Design New Feature – Anchoring Controls

Differences In Form Design New Feature – Docking Controls

Differences In Form Design Advantage – Powerful New Controls (1 of 2)

Differences In Form Design Advantage – Powerful New Controls (2 of 2)

Data Forms In Access 1.Get Data – Make Queries

Data Forms In Access 2.Bind – Set the One RecordSource

Data Forms In Access 3.Bind – Set the ControlSource for all bound controls

Data Forms In.NET 1.Get Data – Create Data Components (DataSets and DataAdapters)

Data Forms In.NET 2.Bind – Set the Many Referenced DataSets

Data Forms In.NET 3.Bind – Set the DataBindings for all bound controls

Differences In Form Design Disadvantage – Database Updates Are Not Done Automatically In Access 1.Changes made on forms are automatically saved In.NET: 1.Add a save button 2.Call DataAdapter.Update(DataSet) in the OnClick event

Differences in Application Design Advantage – All.NET Solution Items are Described in Plain Text In Access Everything is in the MDB If damaged, everything stops working In.NET All solution items are in plain text Forms described in XML Low chance of corruption Lightweight

Differences In Form Design Difference – Data Views AccessVisual Studio.NET DesignSupported FormCompile and Run Application DatasheetNot supported

Navigation Private Sub previousRecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles previousRecord.Click ' Check that the user isn't on the first record. If Not Me._ordersManager.Position = 0 Then _movingRecords = True Me._ordersManager.Position -= 1 _movingRecords = False End If End Sub Private Sub nextRecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nextRecord.Click ' Check that the user isn't on the last record. If Not Me._ordersManager.Position = Me._ordersManager.Count - 1 Then _movingRecords = True Me._ordersManager.Position += 1 _movingRecords = False End If End Sub

Add / Edit Line Items Private Sub editItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles editItem.Click ' Check that there is a row to edit. If Not BindingContext(ordersList, "Orders.OrdersOrder_Details").Position = -1 Then Dim cm As CurrencyManager = CType(BindingContext(ordersList, "Orders.OrdersOrder_Details"), CurrencyManager) ' Get the current row. Dim orderItem As OrdersDataSet.Order_DetailsRow = CType(CType(cm.Current, DataRowView).Row, OrdersDataSet.Order_DetailsRow) ' Pass the current row to the Order Details form. Dim orderDetailsForm As New OrderDetailsPopupForm(orderItem) ' Show the Order Details form and return the result. Dim result As DialogResult = orderDetailsForm.ShowDialog() ' Check if the user clicked "OK". If result = DialogResult.OK Then CalculateTotals() End If End Sub

Save Data Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click Me._ordersManager.EndCurrentEdit() ' Check if changes were made If ordersList.HasChanges Then ' Update the Orders table _ordersDA.Adapter.Update(ordersList) ' Update the Order Details table _orderDetailsDA.Adapter.Update(ordersList) End If End Sub

Differences In Form Design Disadvantage – Multiple Columns Not Supported in Some Controls Use.NET ListView instead of Access Listbox Some programming required for multi-column ComboBox

Differences In Form Design Disadvantage – Multiple Columns Not Supported in Some Controls

Differences In Form Design Disadvantage – The Datasheet View Is Harder to Implement In Access View – Datasheet In.NET: Use DataGrid control Manually bind to database Hard to implement advanced controls (ComboBox etc.)

Differences In Form Design Disadvantage – Continuous Forms Are Harder to Implement (1 of 4) In Access Form Property: Default View = Continuous Forms In.NET Not supported in.NET 2 options –Tiled user controls –Summary/Detail

Differences In Form Design Disadvantage – Continuous Forms Are Harder to Implement (2 of 4) Tiled user controls

Differences In Form Design Disadvantage – Continuous Forms Are Harder to Implement (3 of 4) Split into summary/detail for complex subforms

Differences In Form Design Disadvantage – Continuous Forms Are Harder to Implement (4 of 4) Split into summary with popup window

Differences In Form Design Disadvantage – Subforms are Easier to Use than User Controls (1 of 2) In Access 1.Create parent and sub forms 2.Add subform/subreport to parent 3.Set linkages between parent/subform

Differences In Form Design Disadvantage – Subforms are Easier to Use than User Controls (2 of 2) In.NET 1.Create Orders form (parent) 2.Create user control for Orders Subform form 3.Add property to user control to link parent and subform (code) 4.Update the Orders Subform (user control) when the parent record changes (code) 5.Add the Orders Subform (user control) to the Orders form 6.Bind the Orders form to the Orders Subform (user control) Note: We take a different approach with our example (popup window)

Differences In Form Design Advantage – Form Inheritance 1.Add any common form controls and logic into a base form 2.Create new instances of (“inherit”) the parent form to ensure consistency 3.Make any required changes to logic and controls on child forms

Differences In Form Design Advantage – Use Windows XP Styles Easy to implement in.NET

Differences In Form Design Disadvantage – Read-Only Textboxes are Grayed Out In Access Set Locked = Yes In.NET Set ReadOnly = True Have to explicitly set the background colour

Differences In Form Design Disadvantage – Combo Boxes Cannot Be Locked In Access Set Locked = Yes In.NET No automatic way Capture the SelectedIndexChanged event and reset the value

Differences In Form Design Advantage – Applications Are Stored As Binary Executables In Access Use compact and repair Manually compile as MDE In.NET Application automatically compiled on run Runs efficiently because it is in binary

Differences in Application Design Advantage – Application Deployment is Easier In Access: License for Office Developer Edition (for runtime), or Office installed on target machine In.NET you only need the free.NET Framework

Differences in Application Design Advantage –.NET Versions Can Be Run Side-by-Side In Access: Upgrading Office can cause issues (as we have seen) Can have multiple versions of Office installed – however MDB associations don’t know enough In.NET: Framework versions can run side-by-side Apps using 1.0 continue to work alongside 1.1

Advantage – Extending Your Forms to Mobile Devices Differences in Application Design

Difference – Security Model Integrates with Windows In Access Maintain two sets of security for forms (Access) and backend (SQL)

Differences in Application Design Difference – Security Model Integrates with Windows In.NET Use Windows Integrated security Based on Active Directory – one model for forms and SQL Server Check user’s role in code (using System.Security.Principal namespace)

Differences in Application Design Disadvantage – No Wizard-Based Security In Access: Use the User-level Security Wizard to automatically set object permissions In.NET: Form permissions must be defined in code

Differences in Programming Difference – VBA replaced by VB.NET In Access you use VBA.DLLs In.NET VB.NET, C#, J# etc. Can use components written in other languages

Differences in Programming Advantage – Improved Language Features Structured exception handling Form and code inheritance XML and XSL functionality for web services Simple API wrappers – less API calls –accessing printers –file dialog boxes Improved internationalisation and regional customisation Create and deploy DLLs, user controls and web services in.NET

Differences in Programming Difference – Macros replaced by VB.NET In Access you use the visual macro designer In.NET you must rewrite as code Tip: Use the Macro to VBA converter to simplify rewriting

Differences in Programming Difference – Responding to Form Events.NET – new “Handles” keyword One method can handle multiple events All Access form events can be handled Private Sub OpenCustomer (…) Handles btnOK.Click, cboCustomers.DoubleClick … End Sub

Differences in Programming Advantage – Improved Development Environment (1 of 3) Improved Intellisense

Differences in Programming Advantage – Improved Development Environment (2 of 3) Improved design-time debugging

Differences in Programming Advantage – Improved Development Environment (3 of 3) Visually build database objects

Differences in Programming Advantage – Use Unit Testing Tools to Check Your Code Cannot test code in Access.NET supports testing frameworks eg. nUnit

Differences in Programming Difference – Autoexec Macros vs. Startup Forms/Stubs In Access: –Startup form –Autoexec Macro In.NET: –Select form in project properties –Shared Sub Main()

Summary Current Problems –New versions of Office cause applications to stop working –Corrupt Access databases –Slow, large Access forms –Continual automatic polling of SQL Server, limiting scalability –Hard to integrate with other systems What’s New in.NET Lab: Migrating Access forms to.NET

For More Information… Microsoft Access: Upgrading and Migrating to SQL Server and.NET - Course Resources More courses in March – see Tell your friends…

2 things