3116 Top 10 Techniques for Microsoft.NET Framework Database Developers Cary Jensen President Jensen Data Systems, Inc.

Slides:



Advertisements
Similar presentations
How to Create a Local Collection
Advertisements

ASP.NET Data Binding. Slide 2 Lecture Overview Understanding the ASP.NET data binding model.
Structured Query Language - SQL Carol Wolf Computer Science.
Introduction to Data Adapter. A Simplified View of ADO.Net Objects Ado.Net Data Provider Connection Adapter Command Reader Dataset Data Consumer WinForm.
VB.NET Database Access ISYS 812. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
JavaScript, Fourth Edition
 2008 Pearson Education, Inc. All rights reserved JavaScript: Control Statements II.
Ceng 356-Lab1. Objectives After completing this lesson, you should be able to do the following: Get Familiar with the development environment List the.
Chapter 8 Binding Data to Web Controls. ASP.NET 2.0, Third Edition2.
Chapter 4 – The Building Blocks Data Types Literals Variables Constants.
Rationale Aspiring Database Developers should be able to efficiently query and maintain databases. This module will help students learn the Structured.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Chapter 71 Building Data-Driven ASP.NET Applications Introduction to ASP.NET By Kathleen Kalata.
ADO.NET Tools and Wizards. Slide 2 Data Sources Window (Introduction) Use the Data Sources window to Establish a connection Create bound control instances.
ITS 328 CHAPTER 3: STORING DATA IN MEMORY 1. Storing Data in Memory After today you will be able to: ◦Explain how a DataTable stores data ◦Add new data.
Advanced Visual Basic th Edition Chapter 3: Using SQL Server Databases (c) 2007 Pearson Education Inc. All rights reserved. You may modify and copy.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
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.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Module 1: Introduction to Transact-SQL
.NET Data Access and Manipulation ADO.NET. Overview What is ADO.NET? Disconnected vs. connected data access models ADO.NET Architecture ADO.NET Core Objects.
Introduction to Database Development Using Borland Data Providers 2128 Martin Rudy.
Session 8: ADO.NET. Overview Overview of ADO.NET What is ADO.NET? Using Namespaces The ADO.NET Object Model What is a DataSet? Accessing Data with ADO.NET.
WaveMaker Visual AJAX Studio 4.0 Training Basics: Building Your First Application Binding Basics.
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making Chapter.
ADO.NET Part 2. Slide 2 Overview Slide 3 Introduction to the DataGridView Control It’s a two-dimensional grid containing rows and columns Its use in.
Module 4: Building DataSets. Overview Working in a Disconnected Environment Building DataSets and DataTables Binding and Saving a DataSet Defining Data.
Windows Forms Navigating database with windows forms.
ASP.NET More on searching databases 1ASP.NET, More on searching databases.
Using Adapter Wizard ISYS 512. Data Adapter Wizard – 2 nd Level of Using ADO.Net Configure Data Adapter and generating a dataset: –From the Data tab of.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Database Applications – Microsoft Access Lesson 4 Working with Queries 36 Slides in Presentation.
Copyright  Oracle Corporation, All rights reserved. 5 More on Creating Database Forms Using AppBuilder.
® IBM Software Group © 2006 IBM Corporation Individual Cell Coloring – in a JSF dataTable Control You may need to programmatically (using EGL) change the.
DataBinding. Objectives List and explain the types of binding. Explain Binding Context and CurrencyManager class. List and explain the properties and.
® Microsoft Access 2010 Tutorial 5 Creating Advanced Queries and Enhancing Table Design.
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
1 11/15/05CS360 Windows Programming ADO.NET Continued.
Developing Database Applications with the Microsoft.NET Framework Cary Jensen Jensen Data Systems, Inc.
XPages Example: Generating Dynamic Editable Fields from a Document Collection Author: John Mackey Groupware Solutions Inc.
ASP.NET Data Binding. Slide 2 Lecture Overview Understanding the ASP.NET data binding model.
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.
© 2007 Pearson Addison-Wesley. All rights reserved2-1 Character Strings A string of characters can be represented as a string literal by putting double.
SQL server Section 2&3. What are Data Types Character Data Types Number Data Types Date and Time Data Types CAST and CONVERT functions TRY_PARSE and TRY_CONVERT.
Module 2: Using ADO.NET to Access Data. Overview ADO.NET Architecture Creating an Application That Uses ADO.NET to Access Data Changing Database Records.
CSCI 1100/1202 January 14, Abstraction An abstraction hides (or ignores) the right details at the right time An object is abstract in that we don't.
Creating Advanced Queries and Enhancing Table Design.
Windows Database Applications CIS 341 Chapter 5. Objectives Update database Navigate records Event handler Bound control maintenance Update data source.
1 Copyright © 2007, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
Oracle 10g Retrieving Data Using the SQL SELECT Statement.
1 Copyright © 2009, Oracle. All rights reserved. Retrieving Data Using the SQL SELECT Statement.
Common SQL keywords. Building and using CASE Tools Data Base with Microsoft SQL-Server and C#
Unit 2 Technology Systems
Database, SQL and ADO.NET
Copyright Scott-Jones Publishing, All rights reserved.
VBA - Excel VBA is Visual Basic for Applications
ADO.NET Framework.
Writing Basic SQL SELECT Statements
Wel come.
Data File Import / Export
JavaScript.
VB.NET Using Database.
INPUT & OUTPUT scanf & printf.
Introducing DAX July 11th, 2015.
Recognizing JavaScript Features
PROG Advanced Web Apps 4/13/2019 Programming Data Pages Wendi Jollymore, ACES.
Presentation transcript:

3116 Top 10 Techniques for Microsoft.NET Framework Database Developers Cary Jensen President Jensen Data Systems, Inc.

Overview 1. Expression DataColumns 2. Intermediate DataColumn Expressions 3. Navigating Programmatically 4. Creating Calculated Fields Programmatically 5. Understanding BindingManagers 6. Creating Data Modules 7. Using DataViews 8. Avoiding the SQL Script Hack 9. Synchronzing DataSets and XMLDocuments 10. Computing Expressions on Filtered DataTables

Field References in Expressions  Use the ColumnName property to reference fields  if ColumnName contains one of the following characters, the field reference must be enclosed in brackets: (space), \n (newline), \t (tab), \r (carriage return), ~, (, ), #, \, /, =, >, <, +, -, *, %, &, |, ^, ‘, “, [,]  For consistency, you can use brackets even when the column name does not include one of the special characters.  If your column name includes the ] character, it must be preceded by a \.

Field Reference Examples Column Name AccountNo Account# Last Name Column[1] Reference AccountNo [Account#] [Last Name] [Column[1\]]

Literals  Strings enclosed in single quotes ex: 'Mr ' + [Contact Name]  Dates enclosed between # characters: ex: [Date] - #1/1/2004#  Numeric values, including decimal values and scientific notation, are not delimited ex: [Percent] * 100

String Literals and Delphi Consider the following string assignment (in C#): dataColumn1.Expression = "'Mr ' + [First Name] + ' ' + [Last Name] "; String literals are more complicated for Delphi developers, since single quotes are already used to delimit strings. For example: DataColumn1.Expression := '''Mr ''' + ' + [First Name] + ' + ''' ''' + ' + [Last Name]'; You can also use the QuotedStr function in Borland.Vcl.SysUtils: DataColumn1.Expression := QuotedStr('Mr ') + ' + [First Name] + ' + QuotedStr(' ') + ' + [Last Name]'; Alternatively, enclose string literals between #39, like this: DataColumn2.Expression := #39 + 'Mr ' + #39 + ' + [Invoice No] + ' + #39 + ' ' + #39 + ' + [Customer ID]'; You can even omit the concatenation operator (+) between #39 and strings: DataColumn2.Expression := #39'Mr '#39' + [Invoice No] + '#39' '#39' + [Customer ID]';

Comparison operators (in order of precedence) < > <= >= <> = IN LIKE

Boolean Operators ( expression) AND OR NOT

Table Navigation

DataSets, DataTables, and DataRows r1c1r1c2r1c3r1c4r1c5 r2c1r2c2r2c3r2c4r2c5 r3c1r3c2r3c3r3c4r3c5 DataSet var Table: DataTable; Row: DataRow; data: String; begin Table := DataSet1.Tables[0]; Row := Table.Rows[2]; data := Row[1].ToString(); r1c1r1c2r1c3r1c4r1c5 r2c1r2c2r2c3r2c4r2c5 Table1 Table2

DataSets, DataTables, and DataRows r1c1r1c2r1c3r1c4r1c5 r2c1r2c2r2c3r2c4r2c5 r3c1r3c2r3c3r3c4r3c5 DataSet var data: String; begin data := DataSet1.Tables[0].Rows[2][1].ToString(); //or data := DataSet1.Tables[0].Rows[2][‘rowname’].ToString(); r1c1r1c2r1c3r1c4r1c5 r2c1r2c2r2c3r2c4r2c5 Table1 Table2

Programmatically Create Calculated Fields  Create a DataColumn in your DataTable that will hold the calculated field  After loading data, iterate through the DataTable and assign the calculation. Then make the calculated field to readonly  Add a ColumnChanged event handler to the DataTable  From the ColumnChanged event handler, test whether the changed field is one of those involved in the calculation. If so, make the calculated field writeable, re-calculate the calculation, then make the field readonly once again

Controls and CurrencyManagers  All controls, that is, classes that descend from Control in the.NET FCL, are data aware, and can be bound to a data source. A BindingManagerBase instance is created anytime a control is bound to a new data source.  Controls that are bound to the same data source are bound to the same BindingManagerBase instance. BindingManagerBase is an abstract class, and two concrete classes descend from it. These concrete classes are CurrencyManager and PropertyManager.

Creating a Data Module  Create a form that will serve as the data module (let’s call this form the data module) Add the ADO.NET components that you want to share to the public section of the data module's class declaration.  When the data module is created, create the instances of, and configure, the ADO.NET classes that you added to the form's public section  Add one Control descendant to the data module for each data source that you want to use in other forms. Bind each control to the data source you want to expose.  Declare a variable of the data module class type within scope of each form that must use a data module data source  For each form that uses the data module, assign that form’s BindingContext property to the data module's (form-level) BindingContext property.  For each Control descendant on each form, set the binding context (or DataSource and DataMember properties) to the appropriate data source on the data module.

Questions?

Thank You 3116 Top 10 Techniques for Microsoft.NET Framework Database Developers Please fill out the speaker evaluation You can contact me further at …