Oracle Database Programming with Visual Basic.NET - Ying Bai - E-Book

Oracle Database Programming with Visual Basic.NET E-Book

Ying Bai

0,0
73,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

Oracle Database Programming with Visual Basic.NET Discover a detailed treatment of the practical considerations and applications of Oracle database programming with Visual Basic 2019 Oracle Database Programming with Visual Basic.NET: Concepts, Designs, and Implementations delivers a comprehensive exploration of the foundations of Oracle database programming using Visual Basic.NET. Using Visual Basic.NET 2019, Visual Studio.NET 2019, and Oracle 18c XE, the book introduces the Oracle database development system, Oracle SQL Developer and Modeler, and teaches readers how to implement a sample database solution. The distinguished author also demonstrates the use of dotConnect for Oracle to show readers how to create an effective connection to an Oracle 18c XE database. The current versions of the .NET framework, ASP.NET, and ASP.NET 4.7 are also explored and used to offer readers the most up to date web database programming techniques available today. The book provides practical example projects and detailed, line-by-line descriptions throughout to assist readers in the development of their database programming skill. Students will also benefit from the inclusion of: * A thorough introduction to databases, including definitions, examples, descriptions of keys and relationships, and some database components in popular databases, like Access, SQL, and Oracle * An exploration of ADO.NET, including its architecture and components, like the DataReader class, DataSet component, DataTable component, and the command and parameter classes * A discussion of Language Integrated Query (LINQ), including its architecture and components, its relationship to objects, DataSet, Oracle, and Entities * An explanation of how to access data in ASP.NET and ASP.NET Web Services with multiple real project examples. Perfect for college and university students taking courses related to database programming and applications, Oracle Database Programming with Visual Basic.NET will also earn a place in the libraries of programmers and software engineers seeking a comprehensive reference for database coding in Visual Basic.NET.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 1185

Veröffentlichungsjahr: 2021

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Cover

Series Page

Title Page

Copyright Page

Dedication Page

About the Author

Preface

Acknowledgments

About the Companion Website

1 Introduction

1.1 Outstanding Features About This Book

1.2 Who This Book Is For

1.3 What This Book Covered

1.4 How This Book Is Organized and How to Use This Book

1.5 How to Use Appendices and Related Materials

1.6 How to Use Source Codes and Sample Database

1.7 Instructors and Customer Supports

2 Introduction to Databases

2.1 What Are Databases and Database Programs?

2.2 Develop a Database

2.3 Sample Database

2.4 Identifying Keys

2.5 Define Relationships

2.6 ER Notation

2.7 Data Normalization

2.8 Database Components in Some Popular Databases

2.9 Create Oracle 18c XE Sample Database

2.10 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

3 Introduction to ADO.NET

3.1 The ADO and ADO.NET

3.2 Overview of the ADO.NET

3.3 The Architecture of the ADO.NET

3.4 The Components of ADO.NET

3.5 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

4 Introduction to Language‐Integrated Query (LINQ)

4.1 Overview of Language‐Integrated Query

4.2 Introduction to LINQ

4.3 The Architecture and Components of LINQ

4.4 LINQ to Objects

4.5 LINQ to DataSet

4.6 LINQ to Entities

4.7 LINQ to XML

4.8 Visual Basic.NET Language Enhancement for LINQ

4.9 LINQ To Oracle

4.10 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

5 Query Data from Oracle Database with Visual Basic.NET

Part I: Data Query with Visual Studio.NET Design Tools and Wizards

5.1 A Completed Sample Database Application Example

5.2 Visual Studio.NET Design Tools and Wizards

5.3 Query Data from Oracle Database Using Design Tools and Wizards

5.4 Use Visual Studio Wizards and Design Tools to Query and Display Data

Part II: Data Query with Runtime Objects

5.5 Introduction to Runtime Objects

5.6 Query Data From Oracle Server Database Using Runtime Object

5.7 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

6 Insert Data into Oracle Database with Visual Basic.NET

Part I: Insert Data with Visual Basic.NET Design Tools and Wizards

6.1 Insert Data into a Database

6.2 Insert Data into Oracle Database Using a Sample Project InsertWizard

Part II: Data Insertion with Runtime Objects

6.3 The General Run‐Time Objects Method

6.4 Insert Data into the Oracle Database Using the Run‐Time Object Method

6.5 Insert Data into the Database Using Stored Procedures

6.6 Insert Data into the Database Using the LINQ To DataSet Method

6.7 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

7 Data Updating and Deleting with Visual Basic.NET

Part I: Data Updating and Deleting with Visual Studio.NET Design Tools and Wizards

7.1 Update or Delete Data Against Oracle Databases

7.2 Update and Delete Data For Oracle 18c XE Database

Part II: Data Updating and Deleting with Runtime Objects

7.3 The Run Time Objects Method

7.4 Update and Delete Data for Oracle Database Using the Run Time Objects

7.5 Update and Delete Data against Oracle Database Using Stored Procedures

7.6 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

8 Accessing Data in ASP.NET

8.1 What Is .NET Framework?

8.2 What Is ASP.NET?

8.3 Develop ASP.NET Web Application to Select Data from Oracle Databases

8.4 Develop ASP.NET Web Application to Insert Data into Oracle Databases

8.5 Develop Web Applications to Update and Delete Data in Oracle Databases

8.6 Develop ASP.NET Web Applications with LINQ to Oracle Query

8.7 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

9 ASP.NET Web Services

9.1 What Are Web Services and Their Components?

9.2 Procedures to Build a Web Service

9.3 Build ASP.NET Web Service Project to Access Oracle Database

9.4 Build ASP.NET Web Service Project to Insert Data Into Oracle Databases

9.5 Build ASP.NET Web Service to Update and Delete Data for Oracle Database

9.6 Build Windows‐Based Web Service Clients to Consume the Web Services

9.7 Build Web‐Based Web Service Clients to Consume the Web Services

9.8 Chapter Summary

Homework

I. True/False Selections

II. Multiple Choices

III. Exercises

Appendix A: Download and Install Oracle Database XE 18c

A.1 Download the Oracle Database 18c XE

A.2 Install the Oracle Database 18c XE

Appendix B: Download and Install Oracle SQL Developer

Appendix C: Download and Install DevExpress WinForms

Appendix D: How to Use the Sample Database

Appendix E: How to Export the Sample Database

Appendix F: Download and Install dotConnect Express

Appendix G: How to Use User‐Defined Windows/Web Forms

Appendix H: Download and Install FrontPage Server Extension for Windows 10

Appendix I: Download and Install LinqConnect Express

Index

End User License Agreement

List of Tables

Chapter 2

Table 2.1 LogIn table.

Table 2.2 Faculty table.

Table 2.3 Course table.

Table 2.4 Student table.

Table 2.5 StudentCourse table.

Table 2.6 Faculty table.

Table 2.7 Course (Partial data shown);Faculty (Partial data shown).

Table 2.8 Unnormalized Faculty table with repeating groups.

Table 2.9 Normalized Faculty table.

Table 2.10 The old Course table.

Table 2.11 The new Course table.

Table 2.12 The new Instructor table.

Table 2.13 The data in the Faculty table.

Table 2.14 The data in the Course table.

Table 2.15 The data in the Student table.

Table 2.16 The data in the StudentCourse table.

Table 2.17 The image files in the Faculty table.

Table 2.18 The image files in the Student table.

Chapter 3

Table 3.1 Namespaces for different Data Providers, DataSet, and DataTable.

Table 3.2 The compatibility between the OLEDB and OLEDB.NET.

Table 3.3 The Connection classes and databases.

Table 3.4 The data types and the associated Data Provider.

Table 3.5 The different parameter mappings.

Table 3.6 Methods of the Command class.

Table 3.7 The constructors of the DataAdapter class.

Table 3.8 The public properties of the DataAdapter class.

Table 3.9 The public methods of the DataAdapter class.

Table 3.10 The events of the DataAdapter class.

Table 3.11 Popular properties of the SqlDataReader class.

Table 3.12 Popular methods of the OracleDataReader class.

Table 3.13 Popular Exceptions of the DataReader class.

Table 3.14 Popular constructors of the DataSet class.

Table 3.15 Public properties of the DataSet class.

Table 3.16 Public methods of the DataSet class.

Table 3.17 Public events of the DataSet class.

Table 3.18 Three popular constructors of the DataTable class.

Table 3.19 The popular properties of the DataTable class.

Table 3.20 The popular methods of the DataTable class.

Table 3.21 The public events of the DataTable class.

Table 3.22 The completed FacultyTable.

Chapter 4

Table 4.1 Most Often Used Standard Query Operators.

Table 4.2 LINQ Related Namespaces.

Chapter 5

Table 5.1 Relationship between the Form and Data Table.

Table 5.2 Relationship between each form and data table.

Table 5.3 Controls on the LogIn form.

Table 5.4 Objects for the Selection form.

Table 5.5 Controls on the Faculty form.

Table 5.6 Controls on the Course form.

Table 5.7 Controls on the Student form.

Table 5.8 A part of Faculty and Course data table.

Chapter 6

Table 6.1 TableAdapter DBDirect Methods.

Chapter 7

Table 7.1 TableAdapter DBDirect Methods.

Table 7.2 Variations of Tableadapter.Update() method.

Table 7.3 The data to be recovered in the Faculty table.

Table 7.4 The data to be recovered in the LogIn table.

Table 7.5 The data to be recovered in the Course table.

Table 7.6 The data to be recovered in the StudentCourse table.

Table 7.7 The data to be recovered in the

COURSE

table.

Table 7.8 The data to be recovered in the

STUDENTCOURSE

table.

Table 7.9 Student table.

Chapter 8

Table 8.1 Controls for the LogIn form.

Table 8.2 Validation Controls.

Table 8.3 Controls on the Selection form.

Table 8.4 Controls on the Faculty form.

Table 8.5 Controls on the Course form.

Table 8.6 The original data for the faculty member Ying Bai in the Faculty ta...

Table 8.7 The total number of rows affected or deleted.

Table 8.8 The data to be added into the Faculty table.

Table 8.9 The data to be added into the LogIn table.

Table 8.10 The data to be added into the Course table.

Table 8.11 The data to be added into the StudentCourse table.

Chapter 9

Table 9.1 The Web Service Namespaces

Table 9.2 The first course record to be inserted

Table 9.3 The second course record to be inserted

Table 9.4 The input parameters to the stored procedure

Table 9.5 The deleted records for student Toney Black in all tables

Table 9.6 Deleted data in LogIn table

Table 9.7 Deleted data in StudentCourse table

Table 9.8 Deleted data in Student table

Table 9.9 The updated record for the student Tom Erica

Table 9.10 Deleted data in Student table

Table 9.11 Deleted data in LogIn table

Table 9.12 Deleted data in StudentCourse table

List of Illustrations

Chapter 1

Figure 1.1 Two study levels in the book.

Figure 1.2 Book‐related materials on Web site.

Chapter 2

Figure 2.1 Records and fields in a table.

Figure 2.2 One‐to‐one relationship in the LogIn and the Student tables.

Figure 2.3 One‐to‐many relationship between Faculty and Course tables.

Figure 2.4 Many‐to‐many relationship between Student and Course tables.

Figure 2.5 Relationships in CSE_DEPT database.

Figure 2.6 Relationships are illustrated using MS Access in the CSE_DEPT dat...

Figure 2.7 Commonly used symbols for ER notation.

Figure 2.8 Converting Faculty table into 2NF by decomposing the old table in...

Figure 2.9 Microsoft Access database illustration.

Figure 2.10 SQL Server database structure.

Figure 2.11 Syntax for creating a stored procedure in Oracle.

Figure 2.12 The home page of the Oracle Database 18c XE.

Figure 2.13 The Select Database wizard.

Figure 2.14 The opened Creation Mode wizard.

Figure 2.15 The Deployment wizard.

Figure 2.16 The Database Identification wizard.

Figure 2.17 The Storage Option wizard.

Figure 2.18 The Configuration Option wizard.

Figure 2.19 The User Credential wizard.

Figure 2.20 The Creation Option wizard.

Figure 2.21 The Progress wizard.

Figure 2.22 The Finish wizard.

Figure 2.23 The opened Oracle SQL Developer.

Figure 2.24 The opened New/Select Database Connection wizard.

Figure 2.25 All data components related to our sample database CSE_DEPT.

Figure 2.26 The opened Create User wizard.

Figure 2.27 The opened System Privileges wizard.

Figure 2.28 The opened Quotas wizard.

Figure 2.29 The opened and completed SQL wizard.

Figure 2.30 The completed design view of the LogIn table.

Figure 2.31 The completed data components for LogIn table.

Figure 2.32 The design view of the Faculty table.

Figure 2.33 The completed Faculty table.

Figure 2.34 The completed Course table.

Figure 2.35 The completed Student table.

Figure 2.36 The completed StudentCourse table.

Figure 2.37 The opened Model view for the LOGIN table.

Figure 2.38 The opened Edit Table wizard.

Figure 2.39 The finished Edit Table wizard.

Figure 2.40 The added foreign key LOGIN_FACULTY_FK.

Figure 2.41 The created foreign key in the LOGIN and STUDENT tables.

Figure 2.42 The added Foreign Key wizard.

Figure 2.43 The finished foreign key for the COURSE table.

Figure 2.44 The finished foreign key for STUDENTCOURSE table.

Figure 2.45 The finished Tables and Columns dialog.

Figure 2.46 Relationships among LOGIN, FACULTY, and STUDENT tables.

Figure 2.47 Create a blank solution Oracle Image Solution.

Figure 2.48 Enter the solution name and location.

Figure 2.49 The opened Add new project wizard.

Figure 2.50 The opened Configure your new project wizard.

Figure 2.51 The new created project – Oracle Image Project.

Figure 2.52 Two added data components.

Figure 2.53 The Add Data Source link.

Figure 2.54 The opened Add Connection wizard.

Figure 2.55 The parameters used to connect to our sample database.

Figure 2.56 The opened Data Source Configuration wizard.

Figure 2.57 The connected database and data set OracleImageDataSet.

Figure 2.58 Drag and place three columns in Details format from Faculty tabl...

Figure 2.59 Drag and place three columns in GridView format on Faculty table...

Figure 2.60 The opened Form for adding faculty images.

Figure 2.61 The opened Form for adding faculty images.

Figure 2.62 The modified FIMAGE column.

Figure 2.63 The finished Student table in the Data Source Configuration Wiza...

Figure 2.64 The completed Form for adding student images.

Chapter 3

Figure 3.1 ADO.NET LINQ techniques.

Figure 3.2 A typical architecture of the ADO.NET.

Figure 3.3 Another architecture of the ADO.NET.

Figure 3.4 An example code of the opening a connection.

Figure 3.5 An example code for the cleanup of resources.

Figure 3.6 Four constructors of the Parameter class in Oracle Provider.

Figure 3.7 An example of initializing the property of a Parameter object.

Figure 3.8 Two methods to add Parameter objects in Oracle Provider.

Figure 3.9 Three popular protocols of the constructor of the Command class....

Figure 3.10 An example of creating a OracleCommand object.

Figure 3.11 An example code of running of ExecuteReader() method.

Figure 3.12 A sample code of using the ExecuteScalar() method.

Figure 3.13 An example code of using the ExecuteNonQuery() method.

Figure 3.14 An example of using the OracleDataAdapter to fill the DataSet.

Figure 3.15 An example code of using the OracleDataReader object.

Figure 3.16 A global representation of the DataSet and other data objects.

Figure 3.17 An example of using the DataSet.

Figure 3.18 An example of adding a DataTable into a DataSet.

Figure 3.19 An example of creating a new table and adding data into the tabl...

Figure 3.20 (a, b) The mapping relationship between three layers.

Figure 3.21 Entity Framework architecture.

Figure 3.22 An example of the ADO.NET 4.3 Entity Data Model Designer.

Chapter 4

Figure 4.1 A coding example of using LINQ to Object query.

Figure 4.2 A modification of the coding example of using LINQ to Object quer...

Figure 4.3 A coding example of using LINQ to SQL query.

Figure 4.4 An example code for the operator AsEnumerable.

Figure 4.5 An example code for the operator Cast.

Figure 4.6 An example code for the operator Join.

Figure 4.7 An example code for the operator OfType.

Figure 4.8 An example code for the operator OrderBy.

Figure 4.9 An example code for the operator Select.

Figure 4.10 An example code for the operator Where.

Figure 4.11 An example code for the operator ElementAt.

Figure 4.12 An example code for the operator First.

Figure 4.13 An example code for the operator Last.

Figure 4.14 An example code for the operator Single.

Figure 4.15 An example code for the operator ToArray.

Figure 4.16 An example code for the operator ToList.

Figure 4.17 An example code for the LINQ.

Figure 4.18 The running process of a LINQ.

Figure 4.19 A typical query expression of LINQ.

Figure 4.20 A typical LINQ architecture.

Figure 4.21 The relationship between LINQ to DataSet and ADO.NET 2.0.

Figure 4.22 Relationship between LINQ to Entities, the Entity Framework, and...

Figure 4.23 The codes for the example project NonGenericLINQ.

Figure 4.24 The codes for the example project QueryStringLINQ.

Figure 4.25 The content of the sample text file scores.csv.

Figure 4.26 The codes for the example project SortLinesLINQ.

Figure 4.27 The running result of the project SortLinesLINQ.

Figure 4.28 The codes for the example project QueryContentsLINQ.

Figure 4.29 The codes for the example project QueryReflectionLINQ.

Figure 4.30 The example codes for the query expression syntax.

Figure 4.31 The example codes for the query expression in implicit typing of...

Figure 4.32 The codes for the example project QueryMethodSyntax.

Figure 4.33 The codes for the example project DataSetSingleTableLINQ.

Figure 4.34 The codes for the example project DataSetCrossTableLINQ.

Figure 4.35 The opened Add New Item dialog box.

Figure 4.36 (a, b) The Add Connection dialog and the Server Explorer window....

Figure 4.37 The codes for the example project TypedDataSetLINQ.

Figure 4.38 The codes for the example project DataRowFieldLINQ.

Figure 4.39 The codes for the example project DataRowSetFieldLINQ.

Figure 4.40 An example of expression used in LINQ to Entities.

Figure 4.41 An example of executing the query.

Figure 4.42 A simplified structure of LINQ to Entities.

Figure 4.43 The LINQ to XML class hierarchy.

Figure 4.44 A sample XML file created using LINQ to XML.

Figure 4.45 A sample functional construction.

Figure 4.46 A sample query using LINQ to XML.

Figure 4.47 Some sample codes of using LINQ to XML to insert XML.

Figure 4.48 Some sample codes of using LINQ to XML to update XML.

Figure 4.49 Some sample codes of using LINQ to XML to delete XML.

Figure 4.50 A sample XML attributes.

Figure 4.51 A sample code to create an XAttribut.

Figure 4.52 A sample code to get and delete an XAttribut.

Figure 4.53 A sample code to create an XElement.

Figure 4.54 A sample code to perform the query to an XElement.

Figure 4.55 A sample code to perform the query using query expressions with ...

Figure 4.56 A sample code to perform the query using mixing XML.

Figure 4.57 A sample XML.

Figure 4.58 A piece of sample codes to read and update database.

Figure 4.59 A piece of sample codes for lambda expressions.

Figure 4.60 An example of defining class and instance method.

Figure 4.61 An example of calling class and instance method.

Figure 4.62 The running result of the execution of the extension method.

Figure 4.63 Declare the class method ToUpper() to extension method.

Figure 4.64 Declare an anonymous type variable.

Figure 4.65 Declare an anonymous type variable using implicitly typed local ...

Figure 4.66 An example of using the object initializer.

Figure 4.67 A typical syntax of query expression.

Figure 4.68 A real example of query expression.

Figure 4.69 A LINQ to Object query.

Chapter 5

Figure 5.1 The LogIn Form.

Figure 5.2 The Selection Form.

Figure 5.3 The Faculty Form.

Figure 5.4 The Course Form.

Figure 5.5 The Data components in Toolbox window.

Figure 5.6 The relationship between data components.

Figure 5.7 The Data Sources window.

Figure 5.8 The finished reference selection wizard.

Figure 5.9 The Data Source Configuration Wizard.

Figure 5.10 Choose a database model in the Data Source Configuration Wizard....

Figure 5.11 The Change Data Source wizard.

Figure 5.12 (a, b) The Add Connection and Change Data Source wizards.

Figure 5.13 Choose Your Database Objects wizard.

Figure 5.14 The added data source.

Figure 5.15 A sample DataSet Designer.

Figure 5.16 The opened Preview Data wizard.

Figure 5.17 An example of the Preview Data for Faculty table.

Figure 5.18 The finished project window.

Figure 5.19 The completed Selection form.

Figure 5.20 The finished Faculty form.

Figure 5.21 The completed Course form.

Figure 5.22 The completed Student form.

Figure 5.23 The DataGridView tool.

Figure 5.24 The entire table view for the Faculty table.

Figure 5.25 The Detail view for specified columns.

Figure 5.26 The running status of the Detail view for each record.

Figure 5.27 The Query Build window.

Figure 5.28 The Choose Methods to Generate wizard.

Figure 5.29 The result of the TableAdapter Query Configuration Wizard.

Figure 5.30 The DataBindings property.

Figure 5.31 The created BindingSource object LogInBindingSource.

Figure 5.32 The codes of the LogIn button’s event procedure.

Figure 5.33 The running status of the LogIn form.

Figure 5.34 The warning message.

Figure 5.35 The finished Query Builder.

Figure 5.36 The codes for the btnPW button’s event procedure.

Figure 5.37 (a, b) The running status of the LogIn form.

Figure 5.38 The Selection form.

Figure 5.39 The codes for the Selection Form_Load event procedure.

Figure 5.40 The codes for the OK button’s event procedure.

Figure 5.41 The codes for the Exit button’s click event procedure.

Figure 5.42 (a~c) The expansion for Faculty table data binding.

Figure 5.43 An example of the Query Builder.

Figure 5.44 The codes for the FacultyForm_Load event procedure.

Figure 5.45 The codes for the Select button’s event procedure.

Figure 5.46 The codes for the Back button.

Figure 5.47 The codes for the LINQ to DataSet subroutine.

Figure 5.48 The running status of the Faculty form window.

Figure 5.49 The finished query for the FACULTY_ID.

Figure 5.50 The Query Builder.

Figure 5.51 (a~c) The expansion of the data source.

Figure 5.52 The codes for the CourseForm_Load event procedure.

Figure 5.53 The codes for the Select button’s click event procedure.

Figure 5.54 The codes for the LINQ to DataSet subroutine.

Figure 5.55 The running status of the Course form.

Figure 5.56 The relationships between Course ListBox, Course table and TextB...

Figure 5.57 Classes provided by ADO.NET.

Figure 5.58 The opened Reference Manager wizard.

Figure 5.59 The declaration of the namespace for the Oracle Server Data Prov...

Figure 5.60 The LogIn form window.

Figure 5.61 The codes for the database connection.

Figure 5.62 The codes for the TabLogIn button’s event procedure.

Figure 5.63 The codes for the ReadLogIn button’s event procedure.

Figure 5.64 The codes for the Cancel button’s event procedure.

Figure 5.65 The codes for the SelectionForm_Load event procedure.

Figure 5.66 The codes for the OK Click button's event procedure.

Figure 5.67 The codes for the Exit Click button's event procedure.

Figure 5.68 The codes for the FacultyForm_Load() event procedure.

Figure 5.69 The modified codes for the Select button’s event procedure.

Figure 5.70 The codes for the user‐defined subroutine procedure FillFacultyT...

Figure 5.71 The codes for the user‐defined subroutine procedure MapFacultyTa...

Figure 5.72 The codes for the subroutine procedure FillFacultyReader.

Figure 5.73 The codes for the subroutine procedure ShowFaculty().

Figure 5.74 Three methods to retrieve images from Oracle Server database.

Figure 5.75 The modified codes for the subroutine FillFacultyTable().

Figure 5.76 The modified codes for the subroutine FillFacultyReader().

Figure 5.77 The codes for the CourseForm_Load() event procedure.

Figure 5.78 The codes for the Select button’s event procedure.

Figure 5.79 The codes for two user‐defined subroutine procedures.

Figure 5.80 The codes for the CourseList_SelectedIndexChanged procedure.

Figure 5.81 The codes for two user‐defined subroutine procedures.

Figure 5.82 The codes for the subroutine MapCourseTable.

Figure 5.83 The codes for the Back button’s click event procedure.

Figure 5.84 The Student form window.

Figure 5.85 The codes for the Form_Load event procedure.

Figure 5.86 The syntax of creating a stored procedure in Oracle.

Figure 5.87 The syntax of creating a stored procedure in Oracle.

Figure 5.88 The syntax of creating a package in Oracle.

Figure 5.89 An example of creating a Faculty Package in Oracle.

Figure 5.90 The opened New Package wizard.

Figure 5.91 The opened Package Definition wizard.

Figure 5.92 The finished Package Body wizard.

Figure 5.93 Finished package Student_Info.

Figure 5.94 The opened Run PL/SQL wizard.

Figure 5.95 The running result of package STUDENT_INFO.

Figure 5.96 The definition for the package STUDENT_COURSE.

Figure 5.97 The code body for the package STUDENT_COURSE.

Figure 5.98 The finished package STUDENT_COURSE.

Figure 5.99 The opened Run PL/SQL wizard.

Figure 5.100 The running result of the package STUDENT_COURSE.

Figure 5.101 The codes for the Select button’s Click event procedure.

Figure 5.102 The codes for the subroutine BuildCommand().

Figure 5.103 The codes for the subroutine FillStudent().

Figure 5.104 The codes for the subroutine FillStudentReader().

Figure 5.105 The codes for the subroutine FillCourseReader().

Figure 5.106 The codes for the subroutine MapStudentTextBox().

Figure 5.107 The running status of the Student form.

Chapter 6

Figure 6.1 The form‐level collection object.

Figure 6.2 The codes for the Insert button event procedure.

Figure 6.3 The codes for the subroutine CreateFacultyCollection().

Figure 6.4 The codes for the subroutine RemoveFacultyCollection().

Figure 6.5 The codes for the subroutine procedure CurrentFaculty().

Figure 6.6 The codes for the Form_Load event procedure.

Figure 6.7 The opened Query Builder wizard.

Figure 6.8 The codes for the Insert button event procedure.

Figure 6.9 The codes for the txtID TextChanged event procedure.

Figure 6.10 Detailed codes for the user‐defined function getFcaultyImage()....

Figure 6.11 The codes for the second data insertion method.

Figure 6.12 The codes for the user‐defined function InsertFacultyRow().

Figure 6.13 The running status of inserting a new faculty.

Figure 6.14 The confirmation result of the new inserted faculty member.

Figure 6.15 The Create Procedure wizard.

Figure 6.16 The code body for the procedure.

Figure 6.17 The completed procedure INSERTCOURSESP().

Figure 6.18 The running status of the procedure INSERTCOURSESP().

Figure 6.19 The running result of procedure INSERTCOURSESP().

Figure 6.20 The modified codes in the Form_Load() event procedure.

Figure 6.21 The codes in the Insert button's Click event procedure.

Figure 6.22 The codes for the subroutine CleanInsert().

Figure 6.23 The running result of calling the stored procedure.

Figure 6.24 The codes for the user‐defined subroutine InitFacultyInfo().

Figure 6.25 The codes for the function CheckFacultyInfo().

Figure 6.26 The first piece of codes for the Insert button's Click event pro...

Figure 6.27 The codes for the new subroutine CurrentFaculty().

Figure 6.28 The modified codes for the Form_Load() event procedure.

Figure 6.29 The second piece of codes for the Insert button's event procedur...

Figure 6.30 The codes for the user‐defined subroutine InsertParameters().

Figure 6.31 The codes for the user‐defined subroutine CleanInsert().

Figure 6.32 The codes for the user‐defined function getFacultyImage().

Figure 6.33 The new inserted faculty record in the Faculty Form window.

Figure 6.34 The new inserted faculty member Mhamed Jones.

Figure 6.35 The codes for the stored procedure Insert_FacultyCourse.

Figure 6.36 The code body for the procedure.

Figure 6.37 The completed code body for the procedure.

Figure 6.38 The input parameters for a new course record.

Figure 6.39 The running result of the stored procedure.

Figure 6.40 The modified codes for the Form_Load event procedure.

Figure 6.41 The codes for user‐defined subroutine and function.

Figure 6.42 The first coding part for the Insert button's event procedure.

Figure 6.43 The modifications to the Insert button's Click event procedure....

Figure 6.44 The codes for the user‐defined subroutine InsertParameters().

Figure 6.45 The running status of the Course Form window.

Figure 6.46 The data validation process.

Figure 6.47 The codes for the OracleLingDataSet module.

Figure 6.48 The codes to call the Oracle stored procedure.

Chapter 7

Figure 7.1 The Query Builder for the Update query.

Figure 7.2 The Query Builder for the Delete query.

Figure 7.3 The modified codes for the Form_Load event procedure.

Figure 7.4 The codes for the user defined subroutine CurrentFaculty().

Figure 7.5 The codes for the Update command button's Click event procedure....

Figure 7.6 The codes for the second data updating method.

Figure 7.7 The codes for the user‐defined function UPFacultyRow().

Figure 7.8 The codes for the Delete button's Click event procedure.

Figure 7.9 The codes for the second data deleting method.

Figure 7.10 The running status of the Updated Faculty Form window.

Figure 7.11 The updated faculty record.

Figure 7.12 The relationships among tables.

Figure 7.13 The codes for the data updating operation.

Figure 7.14 The codes for the data deleting query.

Figure 7.15 The updated faculty information window.

Figure 7.16 Modified codes for the btnSelect button's Click event procedure....

Figure 7.17 The modified codes in the CourseForm_Load() event procedure.

Figure 7.18 The codes for the Update button's event procedure.

Figure 7.19 The codes for the user defined procedure UpdateParameters().

Figure 7.20 The codes for the Delete button's event procedure.

Figure 7.21 The opened Create Procedure wizard.

Figure 7.22 The created stored procedure UpdateCourseSP().

Figure 7.23 The finished stored procedure UPDATECOURSESP().

Figure 7.24 The finished information wizard.

Figure 7.25 The updated Faculty table.

Figure 7.26 The finished Create Procedure wizard.

Figure 7.27 The created data deleting stored procedure.

Figure 7.28 The opened COURSE table in our sample database.

Figure 7.29 The recovered course CSE‐438.

Figure 7.30 The codes for the LINQStudent Console project.

Figure 7.31 The running result of project LINQStudent.

Chapter 8

Figure 8.1 The .NET Framework model.

Figure 8.2 The structure of an ASP.NET Web application.

Figure 8.3 ASP.NET Web application file structure.

Figure 8.4 The opened Template wizard.

Figure 8.5 The finished LogIn Web form.

Figure 8.6 The codes for the Page_Load event procedure.

Figure 8.7 The codes for the LogIn button's Click event procedure.

Figure 8.8 The codes for the Cancel button's event procedure.

Figure 8.9 Adding the data validation – RequiredFieldValidator.

Figure 8.10 The finished Selection page.

Figure 8.11 The codes for the Page_Load event procedure of the Selection pag...

Figure 8.12 The codes for the Select button's event procedure.

Figure 8.13 The codes for the Exit button's Click event procedure.

Figure 8.14 The running status of the second page – Selection page.

Figure 8.15 The finished Faculty page.

Figure 8.16 The codes for the Page_Load event procedure.

Figure 8.17 The codes for the Select button's Click event procedure.

Figure 8.18 The codes for the subroutine FillFacultyReader().

Figure 8.19 The codes for the subroutine MapFacultyTable().

Figure 8.20 The codes for the Back button's Click event procedure.

Figure 8.21 The running status of the Faculty page.

Figure 8.22 The finished Course Web page.

Figure 8.23 The codes for the Page_Load() event procedure.

Figure 8.24 The codes for the Select button's Click event procedure.

Figure 8.25 The codes for the subroutine FillCourseReader().

Figure 8.26 The codes for the SelectedIndexChanged event procedure.

Figure 8.27 The codes for the subroutine FillCourseReaderTextBox().

Figure 8.28 The codes for the subroutine MapCourseTable().

Figure 8.29 The running status of the Course page.

Figure 8.30 The detailed course information.

Figure 8.31 The modified codes in the Page_Load() event procedure.

Figure 8.32 The codes for the Insert button's Click event procedure.

Figure 8.33 The codes for the subroutine InsertParameters().

Figure 8.34 The codes for the subroutine getFacultyImage().

Figure 8.35 The codes for the subroutine CleanInsert().

Figure 8.36 The completed codes for the Insert button's Click event procedur...

Figure 8.37 The codes for the function CheckFaculty().

Figure 8.38 The running status of the Faculty page.

Figure 8.39 The data validation process.

Figure 8.40 The codes for the Update button's click event procedure.

Figure 8.41 The codes for the subroutine UpdateParameters().

Figure 8.42 The data updating and validation process.

Figure 8.43 The relationships between five tables.

Figure 8.44 The Foreign Key Relationship wizard.

Figure 8.45 The stored procedure DeleteFaculty_SP().

Figure 8.46 The code body for the stored procedure DeleteFaculty_SP().

Figure 8.47 The completed stored procedure

DELETEFACULTY_SP()

.

Figure 8.48 The Running status of the procedure wizard.

Figure 8.49 The running result of the stored procedure.

Figure 8.50 The updated

FACULTY

table after the deleting action.

Figure 8.51 The codes for the Delete button's Click event procedure.

Figure 8.52 The codes for the subroutine CleanFaculty().

Figure 8.53 Add a new LinqConnect Model.

Figure 8.54 The opened model selection wizard.

Figure 8.55 The opened database connection wizard.

Figure 8.56 The opened database objects selection wizard.

Figure 8.57 The opened Model Properties wizard.

Figure 8.58 The generated model diagram for our LinqConnect model.

Figure 8.59 The modified codes in the function GetConnectionString()

Figure 8.60 Initialization codes for the Faculty Web page.

Figure 8.61 The codes for the Back button Click event procedure.

Figure 8.62 The codes for the Select button Click event procedure.

Figure 8.63 The codes for the Insert button Click event procedure.

Figure 8.64 The codes for the function CheckFaculty().

Figure 8.65 The codes for the subroutine getFacultyImage().

Figure 8.66 The codes for the subroutine MapFacultyTable.

Figure 8.67 The codes for the Update button Click event procedure.

Figure 8.68 The codes for the Delete button Click event procedure.

Figure 8.69 The testing status of the data insertion action.

Figure 8.70 The codes for the Page_Load() event procedure.

Chapter 9

Figure 9.1 A typical process of a Web Service.

Figure 9.2 The service interface and contract.

Figure 9.3 The codes in the client side to call the operation GetData() in t...

Figure 9.4 The opened individual components view.

Figure 9.5 The installation process.

Figure 9.6 Create a new WCF Web Service project.

Figure 9.7 New created items for a WCF Web service project.

Figure 9.8 The modified Web Service project.

Figure 9.9 The default codes for the code‐behind page WebServiceOracleSelect...

Figure 9.10 The running status of the default Web service project.

Figure 9.11 The test method page.

Figure 9.12 The running status of the default method.

Figure 9.13 The modified main service page.

Figure 9.14 The running status of the modified Web service project.

Figure 9.15 The OracleSelectBase class member data.

Figure 9.16 The member data for the class OracleSelectResult.

Figure 9.17 The modified codes to test the connection string.

Figure 9.18 The modified Web method – GetOracleSelect().

Figure 9.19 The modified codes for the Web method.

Figure 9.20 The codes for the subroutine FillFacultyReader().

Figure 9.21 The codes for the subroutine ReportError().

Figure 9.22 The running status of the Web service.

Figure 9.23 The running status of our Web method.

Figure 9.24 The running result of our Web service project.

Figure 9.25 The package WEB_FACULTYINFO.

Figure 9.26 The opened Package Definition wizard.

Figure 9.27 The finished Package Body wizard.

Figure 9.28 The finished package WEB_FACULTYINFO.

Figure 9.29 The opened Run PL/SQL wizard.

Figure 9.30 The running result of the stored procedure.

Figure 9.31 The modified Web method – GetSQLSelectSP().

Figure 9.32 The modified Web method – GetOracleSelectDataSet().

Figure 9.33 Three Web methods in built‐in Web interface window.

Figure 9.34 The running result of the Web method GetOracleSelectDataSet()....

Figure 9.35 The Add Web Reference wizard.

Figure 9.36 The codes for the Form_Load() event procedure.

Figure 9.37 The codes for the Select button's click event procedure.

Figure 9.38 The codes for two user‐defined subroutine procedures.

Figure 9.39 The codes for the subroutine FillFacultyDataSet().

Figure 9.40 The running status of our Web service project WebServiceOracleSe...

Figure 9.41 The running status of our client project.

Figure 9.42 Add a Web reference.

Figure 9.43 The modified Faculty.aspx page.

Figure 9.44 The modified Page_Load event procedure.

Figure 9.45 The modified codes for the Select button's Click event procedure...

Figure 9.46 The modified codes for the subroutine procedure ProcessObject()....

Figure 9.47 The modified codes for the subroutine FillFacultyObject().

Figure 9.48 The modified codes for the subroutine FillFacultyDataSet().

Figure 9.49 The modified codes for the Back button's event procedure.

Figure 9.50 The running status of our Web‐based client project.

Figure 9.51 The completed Add Website wizard.

Figure 9.52 The Customer Profile setup wizard.

Figure 9.53 The Web site Publishing result.

Figure 9.54 Modifications to the first Web method.

Figure 9.55 Detailed codes for the user‐defined function and subroutine.

Figure 9.56 The running status of the built‐in Web interface.

Figure 9.57 The input parameter interface.

Figure 9.58 The running result of the first Web method.

Figure 9.59 The codes for our second Web method GetOracleInsert().

Figure 9.60 The codes for the subroutine FillCourseReader().

Figure 9.61 The running status of our Web service project.

Figure 9.62 The input parameter for the Web method GetOracleInsert().

Figure 9.63 The running result of our Web method GetOracleInsert().

Figure 9.64 The codes for the Web method OracleInsertDataSet().

Figure 9.65 The finished input parameter wizard.

Figure 9.66 The running result of the third Web method.

Figure 9.67 The declaration codes for the package and stored procedure.

Figure 9.68 The finished Package Body wizard.

Figure 9.69 The finished package WEB_SELCOURSEPKG.

Figure 9.70 The running result of package WEB_SELCOURSEPKG.

Figure 9.71 The codes for the Web method GetOracleInsertCourse().

Figure 9.72 The codes for the subroutine FillCourseDetail().

Figure 9.73 The running result of our Web method GetOracleInsertCourse()....

Figure 9.74 The opened Edit User wizard.

Figure 9.75 The finished Add Web Reference wizard.

Figure 9.76 The finished graphic user interface.

Figure 9.77 The codes of the Form_Load and Back button's event procedures.

Figure 9.78 The codes for the Insert button's click event procedure.

Figure 9.79 The codes for the user‐defined function CheckCourse().

Figure 9.80 The codes for the Select button's click event procedure.

Figure 9.81 The codes for the subroutines ProcessObject() and FillCourseList...

Figure 9.82 The codes for the subroutine FillCourseDataSet().

Figure 9.83 The running result of the data validation.

Figure 9.84 The codes for the SelectedIndexChanged() event procedure.

Figure 9.85 The running status of getting the detailed course information....

Figure 9.86 The modified Course page window.

Figure 9.87 The modified Page_Load() event procedure.

Figure 9.88 The codes for the Insert button's Click event procedure.

Figure 9.89 The detailed codes for the user‐defined function CheckCourse()....

Figure 9.90 The codes for the Select button's Click event procedure.

Figure 9.91 The codes for subroutines ProcessObject() and FillCourseListBox(...

Figure 9.92 The codes for the subroutine FillCourseDataSet().

Figure 9.93 The modified codes for the SelectedIndexChanged() event procedur...

Figure 9.94 The codes for the subroutine FillCourseDetail().

Figure 9.95 The running status of getting the detailed course information....

Figure 9.96 The modified namespace.

Figure 9.97 The member data for the class OracleResult.

Figure 9.98 The codes for the Web method OracleUpdateSP().

Figure 9.99 The codes for the user‐defined function and subroutine.

Figure 9.100 The codes for the Web method OracleDeleteSP().

Figure 9.101 The codes for the Web method CurrentStudents().

Figure 9.102 The codes for the user‐defined subroutine FillStudentReader()....

Figure 9.103 The arguments for the stored procedure Web_UpdateStudentSP()....

Figure 9.104 The detailed codes for the procedure

WEB_UPDATESTUDENTSP

.

Figure 9.105 The input parameters to stored procedure Web_UpdateStudentSP()....

Figure 9.106 The running result of the stored procedure Web_UpdateStudentSP(...

Figure 9.107 The opened Create Procedure wizard.

Figure 9.108 The codes for the stored procedure WEB_DELETESTUDENTSP().

Figure 9.109 The Execute Stored Procedure wizard.

Figure 9.110 The modified codes for the Form_Load event procedure.

Figure 9.111 The detailed codes for the subroutine CurrentStudent().

Figure 9.112 Detailed codes for the Update button's Click event procedure.

Figure 9.113 The detailed codes for the function getStudentImage().

Figure 9.114 The codes for the Delete button's click event procedure.

Figure 9.115 The running status of the student updating process.

Figure 9.116 The finished Add Web Reference wizard.

Figure 9.117 The detailed codes for the subroutine CurrentStudent().

Figure 9.118 The codes for the Update button's Click event procedure.

Figure 9.119 The codes for the subroutine GetStudentImage().

Figure 9.120 The codes for the Delete button Click event procedure.

Figure 9.121 The codes for the Select button Click event procedure.

Figure 9.122 The codes for the user‐defined subroutine procedures.

Figure 9.123 Running result of updating a student record.

Appendix A

Figure A.1 The opened Download wizard.

Figure A.2 The downloaded Oracle Database 18c Express Edition.

Figure A.3 Select the desired location for this installation.

Figure A.4 The installation process starts.

Figure A.5 The installation process completes.

Figure A.6 The opened tnsnames.ora file.

Figure A.7 The home page of the Oracle Database 18c XE.

Figure A.8 The configuration page of the Oracle Database 18c XE.

Appendix B

Figure B.1 The opened downloading page for Oracle SQL Developer.

Figure B.2 The opened Extract page.

Figure B.3 The installation process.

Appendix C

Figure C.1 The opened site for DevExpress WinForms component.

Figure C.2 Select WinForms Controls to install the DevExpress WinForms compo...

Figure C.3 The downloading and installation process starts.

Appendix D

Figure D.1 The opened Open wizard.

Figure D.2 The opened sample database CSE_DEPT.sql.

Figure D.3 The running result.

Figure D.4 Example data in the FACULTY table.

Appendix E

Figure E.1 The opened Export wizard.

Figure E.2 The opened Save wizard.

Figure E.3 The finished Export wizard.

Figure E.4 The second step of Export wizard.

Figure E.5 The third step of the Export wizard.

Figure E.6 The export building process.

Figure E.7 The completed exporting results.

Appendix F

Figure F.1 The setup starting wizard.

Figure F.2 The initial installation wizard.

Figure F.3 The license agreement wizard.

Figure F.4 The installation destination wizard.

Figure F.5 The Select Start Menu Folder wizard.

Figure F.6 The installing process starts.

Figure F.7 The option to add the documentation wizard.

Figure F.8 Four newly added Oracle data components.

Figure F.9 The newly added reference libraries.

Appendix G

Figure G.1 (a, b) The opened and finished Solution Explorer window.

Figure G.2 The finished Change Data Source wizard.

Figure G.3 (a, b) The finished Add Connection and Configuration wizards.

Figure G.4 The finished connection with created DataSet.

Figure G.5 The created DataSet object CSE_DEPTDataSet.

Figure G.6 The finished error‐fixed window for the Form1.vb.

Figure G.7 The modified Startup form object.

Guide

Cover Page

Series Page

Title Page

Copyright Page

Dedication Page

About the Author

Preface

Acknowledgments

About the Companion Website

Table of Contents

Begin Reading

Appendix A Download and Install Oracle Database XE 18c

Appendix B Download and Install Oracle SQL Developer

Appendix C Download and Install DevExpress WinForms

Appendix D How to Use the Sample Database

Appendix E How to Export the Sample Database

Appendix F Download and Install dotConnect Express

Appendix G How to Use User‐Defined Windows/Web Forms

Appendix H Download and Install FrontPage Server Extension for Windows 10

Appendix I Download and Install LinqConnect Express

Index

Wiley End User License Agreement

Pages

ii

iv

v

xiv

xv

xvi

xvii

xviii

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

183

184

185

186

187

188

189

190

191

192

193

194

195

196

197

198

199

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

218

219

220

221

222

223

224

225

226

227

228

229

230

231

232

233

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

285

286

287

288

289

290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314

315

316

317

318

319

320

321

322

323

324

325

326

327

328

329

330

331

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372

373

374

375

376

377

378

379

380

381

382

383

384

385

386

387

388

389

390

391

392

393

394

395

396

397

398

399

400

401

402

403

404

405

406

407

408

409

410

411

412

413

414

415

416

417

418

419

420

421

422

423

424

425

427

428

429

430

431

432

433

434

435

436

437

438

439

440

441

442

443

444

445

446

447

448

449

450

451

452

453

454

455

456

457

458

460

461

462

463

464

465

466

467

468

469

470

471

472

473

474

475

476

613

614

615

616

617

618

619

622

625

626

628

629

630

631

632

633

634

636

637

638

639

640

641

642

643

644

645

646

647

648

649

650

651

652

IEEE Press445 Hoes LanePiscataway, NJ 08854

IEEE Press Editorial BoardEkram Hossain, Editor in Chief

Jón Atli Benediktsson  

Xiaoou Li  

Jeffrey Reed  

Anjan Bose  

Lian Yong  

Diomidis Spinellis  

David Alan Grier  

Andreas Molisch  

Sarah Spurgeon  

Elya B. Joffe  

Saeid Nahavandi  

Ahmet Murat Tekalp  

Oracle Database Programming with Visual Basic.NET

Concepts, Designs, and Implementations

Ying Bai

Department of Computer Science and EngineeringJohnson C. Smith University

Copyright © 2021 by The Institute of Electrical and Electronics Engineers, Inc. All rights reserved.

Published by John Wiley & Sons, Inc., Hoboken, New Jersey.Published simultaneously in Canada.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per‐copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750‐8400, fax (978) 750‐4470, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748‐6011, fax (201) 748‐6008, or online at http://www.wiley.com/go/permission.

Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.

For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762‐2974, outside the United States at (317) 572‐3993 or fax (317) 572‐4002.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic formats. For more information about Wiley products, visit our web site at www.wiley.com.

Library of Congress Cataloging-in-Publication Data applied for:

ISBN: 9781119734390

Cover design by WileyCover image: © metamorworks/iStock/Getty Images

This book is dedicated to my wife, Yan Wang, and my daughter, Susan (Xue) Bai.

About the Author

Dr. YING BAI is a Professor in the Department of Computer Science and Engineering at Johnson C. Smith University. His special interests include: artificial intelligences, soft computing, mixed‐language programming, fuzzy logic and deep learning, robotic controls, robots calibrations, and database programming.

His industry experience includes positions as software engineer and senior software engineer at companies such as Motorola MMS, Schlumberger ATE Technology, Immix TeleCom, and Lam Research.

Since 2003, Dr. Bai has published sixteen (16) books with publishers such as Prentice Hall, CRC Press LLC, Springer, Cambridge University Press, and Wiley IEEE Press. The Russian translation of his first book titled Applications Interface Programming Using Multiple Languages was published by Prentice Hall in 2005. The Chinese translation of his eighth book titled Practical Database Programming with Visual C#.NET was published by Tsinghua University Press in China in 2011. Most books are about software programming, serial port programming, fuzzy logic controls in industrial applications, microcontroller controls and programming as well as classical and modern controls on microcontrollers.

During recent years, Dr. Bai has also published more than sixty (60) academic research papers in IEEE Trans. Journals and International conferences.

Preface

Databases have become an integral part of our modern‐day life. We are an information‐driven society. Database technology has a direct impact on our daily lives. Decisions are routinely made by organizations based on the information collected and stored in the databases. A record company may decide to market certain albums in selected regions based on the music preference of teenagers. Grocery stores display more popular items at the eye level and reorders are based on the inventories taken at regular intervals. Other examples include patients' records in hospitals, customers' account information in banks, book orders by the libraries, club memberships, auto part orders, and winter cloth stock by department stores, and many others.

In addition to database management systems, in order to effectively apply and implement databases in real industrial or commercial systems, a good Graphic User Interface (GUI) is needed to allow users to access and manipulate their records or data in databases. Visual Basic.NET is an ideal candidate to be selected to provide this GUI functionality. Unlike other programming languages, Visual Basic.NET is a kind of language that has advantages such as easy‐to‐learn and easy‐to‐be‐understood with little learning curves. In the beginning of Visual Studio.NET 2005, Microsoft integrated a few programming languages such as Visual C++, Visual Basic, C#, and Visual J# into a dynamic model called .NET Framework that makes Internet and Web programming easy and simple, and any language integrated in this model can be used to develop professional and efficient Web applications that can be used to communicate with others via Internet. ADO.NET and ASP.NET are two important submodels of .NET Framework. The former provides all components, including the Data Providers, DataSet, and DataTable, to access and manipulate data against different databases. The latter provides support to develop Web applications and Web services in ASP.NET environment to allow users to exchange information between clients and servers easily and conveniently.

This book is mainly designed for college students and software programmers who want to develop practical and commercial database programming with Visual Basic.NET and relational database such as Oracle XE 18c. The book provides a detailed description about the practical considerations and applications in database programming with Visual Basic.NET 2019 with authentic examples and detailed explanations. More important, a new writing style is developed and implemented in this book, combined with real examples, to provide readers with a clear picture as how to handle the database programming issues in Visual Basic.NET 2019 environment.

The outstanding features of this book include, but no limited to:

A novel writing style is adopted to try to attract students' or beginning programmers' interest in learning and developing practical database programs and to avoid the headache caused by using huge blocks of codes in the traditional database programming books.

Updated database programming tools and components are covered in the book, such as .NET Framework 4.7, LINQ, ADO.NET 4.6, and ASP.NET 4.6, to enable readers to easily and quickly learn and master advanced techniques in database programming and develop professional and practical database applications.

A real completed sample Oracle XE 18c database CSE_DEPT is provided and used for the entire book. Step by step, a detailed illustration and description about how to design and build a practical relational database are provided.

Covered both fundamental and advanced database‐programming techniques to the convenience of both beginning students and experienced programmers.

All projects can be run in Microsoft Visual Studio.NET 2019 with Oracle XE 18c database.

Good textbook for college students, good reference book for programmers, software engineers, and academic researchers.

I sincerely hope that this book can provide useful and practical help and guide to all readers or users who adopted this book, and I will be more than happy to know that you guys can develop and build professional and practical database applications with the help of this book.

Ying Bai

Acknowledgments

First, a special thanks to my wife, Yan Wang, for I could not have finished this book without her sincere encouragement and support.

Special thanks also to Dr. Satish Bhalla, a specialist in database programming and management, especially in SQL Server, Oracle, and DB2, who spent a lot of time preparing materials for Chapter 2.

Many thanks to the Senior Editor, Mary Hatcher, who made this book available to the public, without whose perseverance and hard work this book would not be available in the market. Thanks should also go to the entire editorial team for all their contributions which made it possible to publish this book.

Thanks are extended to the following book reviewers for their valuable suggestions and inputs:

Dr. Jiang (Linda) Xie, Professor, Department of Electrical and Computer Engineering, University of North Carolina at Charlotte.

Dr. Dali Wang, Professor, Department of Physics and Computer Science, Christopher Newport University.

Dr. Daoxi Xiu, Application Analyst Programmer, North Carolina Administrative Office of the Courts.

Finally, but not the least, I would like to express my gratitude to all the people who supported me in completing this book.

About the Companion Website

This book is accompanied by a companion website:

www.wiley.com/go/bai-VB-Oracle

The book companion website includes:

Instructor materials (accessible only by Instructors)

HW DB Project Solutions

HW Question Solutions

Images

Sample Database

Teaching-PPT

Student materials