SQL Server Database Programming With Visual Basic NET Concepts Designs and Implementations Ying Bai - The ebook in PDF format is ready for immediate access
SQL Server Database Programming With Visual Basic NET Concepts Designs and Implementations Ying Bai - The ebook in PDF format is ready for immediate access
com
https://textbookfull.com/product/sql-server-database-
programming-with-visual-basic-net-concepts-designs-and-
implementations-ying-bai/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/sql-server-execution-plans-for-sql-
server-2008-through-to-2017-and-azure-sql-database-3rd-edition-grant-
fritchey/
textbookfull.com
https://textbookfull.com/product/programming-with-microsoft-visual-
basic-2017-diane-zak/
textbookfull.com
https://textbookfull.com/product/pro-sql-server-relational-database-
design-and-implementation-5th-edition-louis-davidson/
textbookfull.com
Pro SQL Server Relational Database Design and
Implementation Sixth Edition Louis Davidson
https://textbookfull.com/product/pro-sql-server-relational-database-
design-and-implementation-sixth-edition-louis-davidson/
textbookfull.com
https://textbookfull.com/product/programming-with-microsoft-visual-
basic-2015-7th-edition-diane-zak/
textbookfull.com
Ying Bai
Department of Computer Science and Engineering
Johnson C. Smith University
Charlotte, North Carolina USA
Copyright © 2020 by The Institute of Electrical and Electronics Engineers, Inc. All rights reserved.
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.
10 9 8 7 6 5 4 3 2 1
This book is dedicated to my wife, Yan Wang
and my daughter, Susan (Xue) Bai.
vii
Contents
Chapter 1 Introduction 1
1.1 Outstanding Features About This Book 2
1.2 This Book Is For 2
1.3 What This Book Covers 2
1.4 How This Book Is Organized and How to Use This Book 5
1.5 How to Use Source Codes and Sample Database 6
1.6 Instructors and Customers Supports 8
7.5.2 Create the Codes to Update and Delete Data from the Course Table 405
7.5.2.1 Develop Two Stored Procedures in the SQL Server Database 407
7.5.2.2 Call the Stored Procedures to Perform the Data Updating and Deleting 409
7.5.3 Update and Delete Data against Databases Using the LINQ to SQL Query 412
7.5.3.1 Update and Delete Data Using LINQ to SQL Query for Student Table 413
7.5.3.2 Create a New Object of the DataContext Class for Student Form 414
7.5.3.3 Develop the Codes for the Select Button Click Event Procedure 415
7.5.3.4 Develop the Codes for the Insert Button Click Event Procedure 416
7.5.3.5 Develop the Codes for the Update Button Click Event Procedure 419
7.5.3.6 Develop the Codes for the Delete Button Click Event Procedure 419
7.5.3.7 Run the Project to Test Data Updating and Deleting Actions for Student Table 421
7.6 Chapter Summary 423
Homework 423
9.3.8 Develop the Stored Procedure to Perform the Data Query 533
9.3.8.1 Develop the Stored Procedure WebSelectFacultySP 533
9.3.8.2 Add Another Web Method to Call the Stored Procedure 534
9.3.9 Use DataSet as the Returning Object for the Web Method 536
9.3.10 Build Windows-based Web Service Clients to Consume the Web Services 538
9.3.10.1 Create a Web Service Proxy Class 539
9.3.10.2 Develop the Graphic User Interface for the Windows-based Client Project 541
9.3.10.3 Develop the Code to Consume the Web Service 541
9.3.11 Build Web-based Web Service Clients to Consume the Web Service 548
9.3.11.1 Create a New Web Site Project and Add an Existing Web Page 548
9.3.11.2 Add a Web Service Reference and Modify the Web Form Window 549
9.3.11.3 Modify the Designer and Codes for the Related Event Procedures 550
9.3.12 Deploy the Completed Web Service to Production Servers 555
9.3.12.1 Publish the Desired Web Service 557
9.4 Build ASP.NET Web Service Project to Insert Data Into SQL Server Database 559
9.4.1 Create a New Web Service Project WebServiceSQLInsert 559
9.4.2 Develop Four Web Service Methods 560
9.4.2.1 Develop Codes for the First Web Method SetSQLInsertSP 561
9.4.2.2 Develop Codes for User Defined Functions and Subroutine Procedures 563
9.4.2.3 Develop the Second Web Method GetSQLInsert 565
9.4.2.4 Develop the Third Web Method SQLInsertDataSet 568
9.4.2.5 Develop the Fourth Web Method GetSQLInsertCourse 572
9.4.3 Build Windows-based Web Service Clients to Consume the Web Services 578
9.4.3.1 Create a Windows-Based Consume Project and a Web Service Proxy Class 578
9.4.3.2 Develop the Graphic User Interface for the Client Project 579
9.4.3.3 Develop the Code to Consume the Web Service 581
9.4.4 Build Web-based Web Service Clients to Consume the Web Services 594
9.4.4.1 Create a New Web Site Project and Add an Existing Web Page 594
9.4.4.2 Add a Web Service Reference and Modify the Web Form Window 595
9.4.4.3 Modify the Codes for the Related Event Procedures 596
9.5 Build ASP.NET Web Service to Update and Delete Data for SQL Server Database 606
9.5.1 Modify the Default Namespace and Add Database Connection String 607
9.5.2 Create Our Customer-Built Base and Returned Classes 608
9.5.3 Create a Web Method to Call Stored Procedure to Update Student Records 609
9.5.4 Create a Web Method to Call Stored Procedure to Delete Student Records 611
9.5.5 Develop Two Stored Procedures WebUpdateStudentSP and WebDeleteStudentSP 613
9.5.5.1 Develop the Stored Procedure WebUpdateStudentSP 613
9.5.5.2 Develop the Stored Procedure WebDeleteStudentSP 616
9.6 Build Windows-Based Web Service Clients to Consume the Web Services 618
9.6.1 Modify the Student Form Window 618
9.6.2 Add a New Web Reference to Our Client Project 619
9.6.3 Build the Codes to the Update Button Click Event Procedure 620
9.6.4 Build the Codes to the Delete Button Click Event Procedure 621
Contents xvii
9.7 uild Web-Based Web Service Clients to Consume the Web Services 624
B
9.7.1 Create a New Web Site Application Project and Add an Existing Web Page 625
9.7.2 Add a Web Service Reference and Modify the Web Form Window 625
9.7.3 Modify the Codes Inside the Back Button Click Event Procedure 626
9.7.4 Add the Codes to the Update Button Click Event Procedure 626
9.7.5 Develop Codes for the Delete Button Click Event Procedure 628
9.8 Chapter Summary 631
Homework 632
Appendix A: Install and Configure SQL Server 2017 Express Database 637
Appendix B: Download and Install DevExpress .NET UI Controls 649
Appendix C: Download & Install FrontPage Server Extension for Windows 10 651
Appendix D: How to Use Sample Database 655
Index 657
xix
Dr. YING BAI is a Professor in the Department of Computer Science and Engineering at Johnson C. Smith
University. His special interests include: artificial intelligent controls, soft-computing, mix-language pro-
gramming, fuzzy logic controls, robotic controls, robots calibrations, and database programming.
His industry experience includes positions as software and senior software engineer at companies such
as Motorola MMS, Schlumberger ATE Technology, Immix TeleCom, and Lam Research.
Since 2003, Dr. Bai has published fifteen (15) books with publishers such as Prentice Hall, CRC Press
LLC, Springer, Cambridge University Press, and Wiley IEEE Press. Two of them were translated into
other languages. 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 eigth
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 about sixty (60) academic research papers in IEEE
Trans. Journals and International conferences.
xxi
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 organiza-
tions 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 eye level and reorders are based on the inventories taken at regular inter-
vals. 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 being easy-to-learn and easy-to-be-understood with little
learning curves. Beginning of Visual Studio.NET 2005, Microsoft integrated a few programming lan-
guages 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 sub-models 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 serv-
ers 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
Microsoft SQL Server 2017. The book provides a detailed description about the practical considerations
and applications in database programming via Visual Basic.NET 2017 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 to how to handle the database
programming issues in Visual Basic.NET 2017 environment.
xxii Preface
The outstanding features of this book include, but are not limited to:
1) A novel writing style is adopted to try to attract students’ or beginning programmers’ interest in learn-
ing and developing practical database programs, and to avoid the headache caused by using huge
blocks of codes in the traditional database programming books.
2) Updated database programming tools and components are covered in the book, such as .NET
Framework 4.6, LINQ, ADO.NET 4.5 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.
3) A real completed sample database CSE_DEPT with Microsoft SQL Server 2017 is provided and used
for entire book. Step by step, a detailed illustration and description about how to design and build a
practical relational database are provided.
4) Covers both fundamental and advanced database-programming techniques to convenience both
beginning students and experienced programmers.
5) Various actual data providers are discussed and implemented in the sample projects, such as the SQL
Server and OleDb data providers. Instead of using the OleDb to access the SQL Server, the real SQL
Server data provider is utilized to connect to the Visual Basic.NET 2017 directly to perform data
operations.
6) All projects can be run in Microsoft Visual Studio.NET 2019 even they are developed and built with
Visual Studio.NET 2017.
7) 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 can guide all readers or users
who adopted this book to develop and build professional and practical database applications.
Ying Bai
xxiii
Acknowledgment
The first and most special thanks to my wife, Yan Wang, and I could not have finished this book without
her sincere encouragement and support.
My special thanks to Dr. Satish Bhalla who is the chapter contributor for this book. Dr. Bhalla is a spe-
cialist in database programming and management, especially in SQL Server, Oracle, and DB2. Dr. Bhalla
spent a lot of time preparing materials for Chapter 2 and he deserves thanks for this.
Many thanks to the Editor, Mary Hatcher, who made this book available to the public. This book would
not have reached the market without her deep perspective and hard work. The same thanks are extended
to the editorial team of this book. Without their contributions, it would be impossible for this book to be
published.
These thanks should also be extended to the following book reviewers for their precious opinions to
this book:
●● 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.
Last but not least, thanks should be forwarded to all people who have supported me to finish this book.
xxiv
The companion website consists of a student website and an instructor website, and contains:
●● Student Website
○○ DB Projects
○○ Images
○○ Sample Database
○○ VB Forms
●● Instructor Website
○○ DB Projects
○○ HW Solutions
○○ Images
○○ Sample Database
Chapter 1
Introduction
For many years during my teaching database programming and Visual Basic.NET programming courses
in my college, I found that it is too difficult to find a good textbook for this topic so that I had to combine
a few different professional books together as references to teach these courses. Most of those books are
specially designed for programmers or software engineers, which cover a lot of programming strategies
and huge blocks of codes, which is a terrible headache to the college students or beginning programmers
who are new to the Visual Basic.NET and database programming. I have to prepare my class presenta-
tions and figure out all homeworks and exercises for my students. I dreamed that one day I could find a
good textbook that is suitable for college students or beginning programmers and help them to learn and
master the database programming with Visual Basic.NET easily and conveniently. Finally, I decided that
I needed to do something for this dream myself after a long time of waiting.
Another reason for me to have this idea is the job market. As you know, most industrial and commercial
companies in the US belong to database applications businesses such as manufacturers, banks, hospitals,
and retailers. The majority of them need professional people to develop and build database-related applica-
tions, but not database management and design systems. To enable our students to become good candidates
for those companies, we need to create a book like this one.
Unlike most database programming books in the current market, which discuss and present the data-
base programming techniques with huge blocks of programming codes from the first page to the last
page, this book tries to use a new writing style to show readers, especially college students, how to
develop professional and practical database programs in Visual Basic.NET 2017 by using Visual Studio.
NET Design Tools and Wizards related to ADO.NET 4.5, and to apply codes that are auto-generated by
various Wizards. By using this new style, the headache caused by using those huge blocks of program-
ming codes can be removed, instead, a simple and easy way to create database programs using the Design
Tools can be taken to attract students’ learning interest, and furthermore to enable students to build
professional and practical database programming in more efficient and interesting ways.
There are so many different database-programming books available on the market, but rarely can you
find a book like this one, which implemented a novel writing style to attract the students’ learning inter-
ests in this topic. To meet the needs of some experienced or advanced students or software engineers, the
book contains two programming methods: the interesting and easy-to-learn fundamental database pro-
gramming method – Visual Studio.NET Design Tools and Wizards, and advanced database programming
SQL Server Database Programming with Visual Basic.NET: Concepts, Designs and Implementations, First Edition. Ying Bai.
© 2020 The Institute of Electrical and Electronics Engineers, Inc. Published 2020 by John Wiley & Sons, Inc.
Companion website: www.wiley.com/go/bai/sql
2 Chapter 1 Introduction
method – runtime object method. In the second method, all database-related objects are created and
applied during or when your project is running by utilizing quite a few blocks of codes.
1) All programming projects can be run in Microsoft Visual Studio.NET 2019 even if all of them are
developed and built in Visual Studio.NET 2017.
2) A novel writing style is adopted to try to attract students’ or beginning programmers’ interests 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.
3) Updated database programming tools and components are covered in the book, such as .NET
Framework 4.6, LINQ, ADO.NET 4.5 and ASP.NET 4.7, to enable readers to easily and quickly learn
and master advanced techniques in database programming and develop professional and practical
database applications.
4) A real completed sample database CSE_DEPT with Microsoft SQL Server 2018 database engine 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.
5) both fundamental and advanced database-programming techniques are covered to convenience both
beginning students and experienced programmers.
6) Various actual data providers are discussed and implemented in the sample projects, such as OleDb,
ODBC and SQL Server data providers. Instead of using the OleDb to access the SQL Server, the real
SQL Server data provider is utilized to connect to the Visual Basic.NET 2017 directly to perform data
operations.
7) The book provides homework and teaching materials, and these allow instructors to organize and pre-
pare their courses easily and rapidly, and enable students to understand what they learned better by
doing something themselves.
8) Good textbook for college students, good reference book for programmers, software engineers, and
academic researchers.
This book is designed for college students and software programmers who want to develop practical and
commercial database programming with Visual Basic.NET and relational databases such as Microsoft
SQL Server 2018. Fundamental knowledge and understanding on Visual Basic.NET and Visual Studio.
NET IDE is assumed.
Nine chapters are included in this book. The contents of each chapter can be summarized as below:
●● Chapter 1 provides an introduction and summarization to the whole book.
1.3 What This Book Cover 3
●● Chapter 2 provides a detailed discussion and analysis of the structure and components about rela-
tional databases. Some key technologies in developing and designing database are also given and
discussed in this part. The procedure and components used to develop a practical relational database
with SQL Server 2018 is analyzed in detailed with some real data tables in our sample database
CSE_DEPT.
●● Chapter 3 provides an introduction to the ADO.NET, which includes the architectures, organizations
and components of the ADO.NET. Detailed discussions and descriptions are provided in this chapter
to give readers both fundamental and practical ideas and pictures in how to use components in ADO.
NET to develop professional data-driven applications. Two ADO.NET architectures are discussed to
enable users to follow the directions to design and build their preferred projects based on the different
organizations of the ADO.NET. Four popular data provides, such as OleDb, ODBC, SQL Server and
Oracle, are discussed in detail. The basic ideas and implementation examples of DataTable and DataSet
are also analyzed and described with some real coding examples.
●● Chapter 4 provides a detailed discussion and analysis about the Language-Integrated Query (LINQ),
which includes LINQ to Objects, LINQ to DataSet, LINQ to SQL, LINQ to Entities, and LINQ to XML.
An introduction to LINQ general programming guide is provided at the first part in this chapter. Some
popular interfaces widely used in LINQ, such as IEnumerable, IEnumerable(Of T), IQueryable and
IQueryable(Of T), and Standard Query Operators (SQO) including the deferred and non-deferred
SQO, are discussed in that part. An introduction to LINQ Query is given in the second section in this
chapter. Following this introduction, a detailed discussion and analysis about the LINQ queries that is
implemented for different data sources is provided in detail.
●● Starting from Chapter 5, the real database programming techniques with Visual Basic.NET such as
data selection queries are provided and discussed. Two parts are covered in this chapter: Part I
contains the detailed descriptions in how to develop professional data-driven applications with the
help of the Visual Studio.NET design tools and wizards with some real projects, and this part con-
tains a lot of hiding codes that are created by Visual Basic.NET automatically when using those
design tools and wizards. Therefore, the coding for this part is very simple and easy. Part II covers
an advanced technique, the runtime object method, in developing and building professional data-
driven applications. Detailed discussions and descriptions about how to build professional and
practical database applications using this runtime method are provided combined with four real
projects.
●● Chapter 6 provides detailed discussions and analyses about three popular data insertion methods with
Microsoft SQL Server 2018 database:
1) Using TableAdapter’s DBDirect methods TableAdapter.Insert() method
2) Using the TableAdapter’s Update() method to insert new records that have already been added into
the DataTable in the DataSet
3) Using the Command object’s ExecuteNonQuery() method.
This chapter is also divided into two parts: Methods 1 and 2 are related to Visual Studio.NET design
tools and wizards and therefore are covered in Part I. The third method is related to runtime object and
therefore it is covered in Part II. Three real projects are used to illustrate how to perform the data inser-
tion into the Microsoft SQL Server 2018 database. Some professional and practical data validation
methods are also discussed in this chapter to confirm the data insertion.
4 Chapter 1 Introduction
●● Chapter 7 provides discussions and analyses on three popular data updating and deleting methods
with four real project examples:
1) Using TableAdapter DBDirect. methods such as TableAdapter.Update() and TableAdapter.Delete() to
update and delete data directly again the databases.
2) Using TableAdapter.Update() method to update and execute the associated TableAdapter’s proper-
ties such as UpdateCommand or DeleteCommand to save changes made for the table in the DataSet
to the table in the database.
3) Using the run time object method to develop and execute the Command’s method ExecuteNonQuery()
to update or delete data again the database directly.
This chapter is also divided into two parts: Methods 1 and 2 are related to Visual Studio.NET design tools
and wizards and therefore are covered in Part I. The third method is related to runtime object and it is
covered in Part II. Four real projects are used to illustrate how to perform the data updating and deleting
against the database Microsoft SQL Server 2018. Some professional and practical data validation methods
are also discussed in this chapter to confirm the data updating and deleting actions. The key points in
performing the data updating and deleting actions against a relational database, such as the order to exe-
cute data updating and deleting between the parent and child tables, are also discussed and analyzed.
●● Chapter 8 provides introductions and discussions about the developments and implementations of
ASP.NET Web applications in Visual Basic.NET 2017 environment. At the beginning of Chapter 8, a
detailed and complete description about the ASP.NET and the .NET Framework is provided, and this
part is especially useful and important to students or programmers who do not have any knowledge or
background in the Web application developments and implementations. Following the introduction
section, a detailed discussion on how to install and configure the environment to develop the ASP.NET
Web applications is provided. Some essential tools such as the Web server, IIS and FrontPage Server
Extension 2000, as well as the installation process of these tools are introduced and discussed in detail.
Starting from section 8.3, the detailed development and building process of ASP.NET Web applications
to access databases are discussed with four real Web application projects. The popular database SQL
Server 2018 is utilized as the target databases for those development and building processes.
●● Chapter 9 provides introductions and discussions about the developments and implementations of
ASP.NET Web services in Visual Basic.NET 2017 environment. A detailed discussion and analysis
about the structure and components of the Web services is provided at the beginning of this chapter.
One of the most popular databases, Microsoft SQL Server 2018, is discussed and used for three kinds
of example Web service projects, which include:
1) WebServiceSQLSelect
2) WebServiceSQLInsert
3) WebServiceSQLUpdateDelete.
Each Web service contains different Web methods that can be used to access different databases and
perform the desired data actions such as Select, Insert, Update, and Delete via the Internet. To consume
those Web services, different Web service client projects are also developed in this chapter. Both
Windows-based and Web-based Web service client projects are discussed and built for each kind of Web
service listed above. Totally nine (9) projects, including the Web service and the associated Web service
client projects, are developed in this chapter. All projects have been debugged and tested and can be run
in any Windows compatible operating systems such as Windows XP, Windows 7/8 and Windows 10.
1.4 How This Book Is Organized and How to Use This Boo 5
1.4 How This Book Is Organized and How to Use This Book
This book is designed for both college students who are new to database programming with Visual Basic.
NET and professional database programmers who has professional experience on this topic.
Chapters 2, 3, and 4 provide the fundamentals on database structures and components, ADO.NET
and LINQ components. Starting from chapter 5, which includes chapters 6 and 7, each chapter is
divided into two parts: fundamental part and advanced part. The data driven applications developed
with design tools and wizards provided by Visual Studio.NET, which can be considered as the funda-
mental part, have less coding-loads and therefore they are more suitable to students or programmers
who are new to the database programming with Visual Basic.NET. Part II contains the runtime object
method and it covers a lot of coding developments to perform the different data actions against the
database, and this method is more flexible and convenient to experienced programmers event a lot of
coding jobs is concerned.
Chapters 8 and 9 give a full discussion and analysis about the developments and implementations
of ASP.NET Web applications and Web services. These technologies are necessary to students and
programmers who want to develop and build Web applications and Web services to access and manip-
ulate data via Internet.
Based on the organization of this book we described above, this book can be used as two categories
such as Level I and Level II, which is shown in Figure 1.1.
For undergraduate college students or beginning software programmers, it is highly recommended to
learn and understand the contents of Chapters 2, 3, and 4, Part I of Chapters 5, 6, and 7 since those are
fundamental knowledge and techniques in database programming with Visual Basic.NET 2017. For
chapters 8 and 9, these areoptional to instructors and dependent on the time and schedule.
Level I
Chapter 2 Level II
Part I Part II
Chapter 5 Chapter 5
Part I Part II
Chapter 6 Chapter 6
Part I Part II
Chapter 7 Chapter 7
Optional
Chapter 8 Chapter 8
Chapter 9 Chapter 9
For experienced college students or software programmers who have already some knowledge and
techniques in database programming, it is recommended to learn and understand the contents of Part II
of Chapters 5 ~ 7 as well as Chapters 8 and 9 since the run-time data objects method and some sophisti-
cated database programming techniques such as joined-table query and nested stored procedures are
discussed and illustrated in those chapters with real examples. Also, the ASP.NET Web applications and
ASP.NET Web services are discussed and analyzed with many real database program examples for SQL
Server 2018 database.
All source codes in each project developed in this book are available, and all projects are categorized into
the associated chapters that are located at the folder DB Projects that is located at the site www.wiley.
com/go/bai/sql. You can copy or download those codes into your computer and run each project as you
like. To successfully run those projects, the following conditions must be met:
●● Visual Studio.NET 2017 or higher must be installed in your computer.
●● The database management system, Microsoft SQL Server 2018 Management Studio 18, must be
installed in your computer.
●● The sample database, CSE_DEPT.mdf, must be installed in your computer in the appropriate
folders.
●● To run projects developed in Chapters 8 and 9, in addition to conditions listed above, an Internet
Information Services (IIS) such as FrontPage Server Extension 2000 or 2002 must be installed in your
computer and it works as a pseudo server for those projects.
All related teaching and learning materials, including the sample databases, example projects, home-
work solutions, faculty and student images as well as sample Windows forms and Web pages, can be
found from the associated folders, Instructors or Students, located at the Wiley ftp site www.wiley.
com/go/bai/sql, as shown in Figure 1.2.
These materials are categorized and stored at different folders in two different sites based on the teach-
ing purpose (for instructors) and learning purpose (for students):
1) Sample Database Folder: Contains our sample database, CSE_DEPT.mdf (SQL Server 2018). Refer
to Appendix D to get details in how to use this database for your applications or sample projects.
2) DB Projects Folder: Contains all sample projects developed in the book. Projects are categorized and
stored at different Chapter subfolder based on the book chapter sequence. Readers can directly use the
codes and GUIs of those projects by downloading them from the DB Projects folder at the Wiley ftp
site.
3) Images Folder: Contains all sample faculty and student image files used in all sample projects in the
book. Readers can copy and paste those image files to their projects to use them.
4) VB Forms Folder: Contains all sampled Windows-based Forms and Web-based Pages developed and
implemented in all sample projects in the book. All Windows-based Forms are located at the Window
subfolder, and all Web-based Pages are located at the Web subfolder. Readers can use those Forms or
Pages by copying and pasting them into their real projects.
5) TeachingPPT Folder: Contains all MS-PPT teaching slides for each chapter.
1.5 How to Use Source Codes and Sample Databas 7
FOR INSTRUCTORS:
FOR STUDENTS:
DB Projects
Chapter 6 8-Student
Web Images
3 Projects
LogIn Page
Chapter 7
Faculty Page 4 Projects
Course Page
Student Page Chapter 8
4 Projects
Selection Page
Chapter 9
9 Projects
D
URING the Venetian period, with the increasing wealth and
consequence of Ragusa, the city itself was beautified by the
erection of numerous handsome buildings, both lay and
ecclesiastical, and by 1358 it was almost entirely reconstructed. In
its early days the walls, the castle, and one or two churches were
the only stone edifices; all the rest of the town was of timber.
Throughout the thirteenth and fourteenth centuries the defences
were increased, new bastions erected, and the older walls
strengthened. The city now occupied both the seaward ridge and the
slopes of Monte Sergio. The walls by which it was surrounded
climbed painfully over the rocky eminences on each side, and
dropped down almost to the sea-level in between. The fortifications
did not acquire their present aspect until the sixteenth century, but
parts of them were begun much earlier. Four towers were erected at
the entrance of the harbour on the south-east side of the town, of
which two—San Luca and San Giovanni—still survive. The latter,
which is now called the Forte Molo, a huge round bastion, has been
considerably altered in later times; San Luca has preserved more of
its original character. Of the tower called the Campana Morta (the
dead bell),261 few traces beyond the name survives. The sea-tower
which occupies its site is evidently of a much later date. These
towers were garrisoned by the town guard of 127 men, who were
chosen by lot from the citizens every month, and increased in times
of danger.262 Other towers were built at intervals along the walls,
and their defence was entrusted to the private families whose
houses they adjoined. Of these the most important was the Torre
Menze or Minćeta, one of the most beautiful features of the city. Its
erection was decreed on July 3, 1319, but it was entirely rebuilt in
the fifteenth century, and considerably altered in the sixteenth. It
stands on one of the highest points of the town on the Monte
Sergio.
Of the other buildings of this time there are some important
remains, from which we may resume a fair idea of Ragusan
architecture under the Venetians. Its characteristic note at all times
is the fact that early forms were preserved here, as in other parts of
Dalmatia, down to a much later date than in the rest of Europe. The
style is a mixture of Italian with an Oriental touch, and occasionally,
according to Mr. Jackson, even a German element. During the
Venetian age traces of Byzantine art still survive, and in buildings of
the fourteenth century, a time when Italian Gothic was most
flourishing, we find the round arch of Romanesque art. But Ragusan
builders did not follow any very distinct system. The various styles
were no more than tapped by them. None were fully developed; and
in every building, from whichever point of view we regard it, we find
many deviations from strict orthodoxy. Some of the Ragusan
architects and master-masons had been educated in Italy, others
perhaps at Constantinople, but no part of their work shows an
absolute grasp over any definite style. Nevertheless it is extremely
interesting, and proves them by no means deficient in artistic sense.
Many of the buildings of this little Republic are of great beauty, and
the whole ensemble of edifices compares favourably with many a
more famous Italian town.
The principal buildings erected or completed between 1200 and
1350 are the following: The cathedral church of Santa Maria (1206-
1250), San Biagio (1348), the church and monastery of the
Franciscans (begun 1319), the Dominican church and monastery
(1254-1306), the Castello (1350, on the site of an earlier building),
and the Sponza or custom house, begun early in the fourteenth
century. The cathedral was destroyed by the earthquake of 1667,
San Biagio by fire in 1706, the Castello supplanted by another
building in 1388. The Franciscan and Dominican churches were
almost entirely rebuilt in later times, but of their monasteries much
remains, and the cloisters are in their original state. The Sponza,
too, survives, although the top story, the façade, and the portico
were added subsequently.
What the Duomo was like we can only discover from the somewhat
confused account of De Diversis, and from the model of the town in
the hands of the silver statuette of San Biagio. According to local
tradition, it was erected through the munificence of Richard Cœur-
de-Lion, King of England, who on returning from the Holy Land
encountered a terrible storm off Corfu, and made a vow that he
would build a church to the Virgin on the spot where he should first
touch land in safety. After being tossed
about for several days he was able to land
on the island of Lacroma, near Ragusa. In
fulfilment of his vow he built the church, at
the request of the citizens, in Ragusa itself,
as well as a small chapel on the island.
There is, however, no evidence of the truth
of this story, and none of the contemporary
accounts of Richard’s peregrinations even
mention Ragusa, while the entries in the
Ragusan archives state that the church was
built with the contributions of the nobles.
According to De Diversis, it was the most
CAPITAL IN THE
beautiful church in Dalmatia. It consisted of
FRANCISCAN CLOISTER
a nave and side aisles separated by great
columns; and from the above-mentioned model of the city we see
that it had a cupola mounted on a drum pierced with windows and a
clerestory. De Diversis also speaks of a curious ambulatory formed
by small columns outside the church, the walls of which were
ornamented with figures of animals. In the choir was the high altar,
with a pala of silver under a beautiful ciborium supported on four
pillars. The floors were of mosaic, and the windows all filled with
stained glass. On the walls were depicted scenes from the Old
Testament and the New. All this bespeaks a Romanesque building
with traces of Byzantine art. But alas! nothing remains of this
exquisite piece of architecture; the present church (1671-1713) is a
large classical edifice with barocco
ornamentation.
The original church of San Biagio was
begun in 1348 as a votive offering after the
plague of that year. From De Diversis’s
description it was very similar to the
Duomo, but on a smaller scale. It suffered
little damage from the earthquake, but was
burnt down in 1706. Both this church and
the Duomo are fairly good examples of an
unattractive style, and the stone of which
CAPITAL IN THE
they are built is of a rich mellow tone.
FRANCISCAN CLOISTER
The two stately piles at each end of the
town—the Franciscan and Dominican monasteries—have fortunately
preserved much of their original character. The latter was begun
after the destruction of the first Franciscan house outside the Porta
Pile by the Slaves in 1319, and the new building was erected just
within the gate, which its inmates were to guard in times of danger.
The church and a large part of the monastery have been rebuilt
since the earthquake, although here and there a few interesting
details remain. Thus on the south side, opening on to the Stradone,
there is a handsome doorway in the Venetian Gothic style,
surmounted by a Pietà, a very fair piece of sculpture; the date is
probably the end of the fifteenth century. In the sacristy we find a
Renaissance lavabo of carved stone. The campanile marks the
transition from the Romanesque to the Gothic. The east window of
the lower story and those on the second story are Venetian Gothic,
while the south window of the lower story is round-arched. The top
story with the cupola was rebuilt after the earthquake. But it is in
the cloister that the chief interest of the building lies, a cloister
which Mr. T. G. Jackson calls “one of the most singular pieces of
architecture I have ever seen.”263 Here we observe the most notable
feature of Dalmatian architecture in all its force, for although its date
is later than 1319 it is thoroughly Romanesque in character, and all
the arches are round. It consists of a courtyard with three bays
opening out into it on each side; the openings are divided into six
round-headed lights, each head being pierced by a large circular
light. A series of coupled octagonal shafts standing one behind the
other, with a common base and common abacus, but separate
capitals, serve as mullions to the arches. The capitals are extremely
quaint and curious. Each one is different from its fellows, and the
architect seems to have let his fancy run riot in designing them,
“recalling the wildest and most grotesque fancies of early
Romanesque work.”264 Some are adorned with simple foliage, spiral
volutes, and block leaves, but on others we find hideous grinning
faces, dragons, strange uncouth monsters, masks, dogs, and all
manner of fanciful ornaments. Judged by ordinary standards, we
should take them to be work of the twelfth or thirteenth century, but
as a matter of fact they are of a much later date. According to
Eitelberger, these early forms were preserved in most of the
monasteries of the East when they had given place to Gothic in
Western Europe.265 The workmanship of these capitals, like much
Ragusan carving, is somewhat rough and unfinished, but for this the
material, which is not sufficiently hard, may be partly responsible. Of
the open circles in the heads of the opening, the centre one on each
side of the cloister is larger, and ornamented with a rich border of
acanthus leaves; the others are cusped. Possibly it was intended that
they should all contain some ornamentation, and indeed the large
round openings look somewhat bare. Above the cloister is an elegant
balustrade, of which only one side survived the earthquake, but a
few years ago it was restored according to the original design. The
name of the architect has been preserved in an inscription in the
cloister itself:
☩ S · DE · MAGIST
ER MYCHA PETRAR
DANTIVAR QVIPPE
CITCLAVSTRVM
CVM OMNIBVS SVIS.
He was one Mycha of Antivari, a town where Byzantine influence
was stronger than at Ragusa. The inscription has no date, but it is
close to two others of 1363 and 1428, and the style of the lettering,
according to Jackson, is even earlier than 1363. The building was
not begun until after 1319, when the former Franciscan monastery
was destroyed, so that the date is somewhere between 1319 and
1363. Within the enclosure are orange trees and evergreen shrubs,
and a graceful little fountain is placed in the centre; the whole scene
forms a most charming picture of mediæval monastic life. A second
cloister higher up the hillside served as a garden where the simples
for the monks’ pharmacy were grown. This, too, is a delightful old-
world nook.
At the opposite end of the town, just inside the Porta Ploce, stands
the massive group of the Dominican church and monastery. These
buildings originally formed the southern bulwark of the town, the
monks themselves, like the Franciscans, being entrusted with the
defence of the gate; but later a second wall was built outside it. The
church, which was begun in 1245 and completed in 1360, consists of
a vast nave separated from a polygonal choir by a high arch. The
building is extremely bare; the traces of Gothic arches and clustered
pillars form a sort of skeleton, around which the existing church was
constructed in the seventeenth century. In the sacristy there are a
few more fragments of early work, and the south doorway, with a
round arch of many receding orders under an ogee crocketed hood
mould, also belongs to the original church. Jackson notices a strong
flavour of German Gothic in it. There are several pointed windows of
extreme simplicity, and a large round one decorated with an outside
frill of small Venetian arches. The campanile was begun in 1424266
by Fra Stefano, a Dominican, but it was not completed in 1440, for
De Diversis says of it, “nondum perfectum, in dies crescit.” It has
round arches and shafts set back to the centre of the wall.
But as in the Franciscan monastery, the cloister is almost untouched.
It is an irregular square, with five bays on each side, each bay being
divided by three lights, the head pierced by two irregular lights
above. The style is a curious medley “of Gothic and Renaissance, of
forms understood and otherwise, as indeed could only occur in a
land which, being on the borders of Eastern and Western culture, did
not possess the power to create and execute the various styles
correctly.”267 The arches of the bays are round, but the inside work
has more the character of Venetian Gothic, especially in the foliage.
The shield of the semicircular head is pierced by quatrefoil lights
encircled alternately with an ornament of interlacing circles almost
Byzantine in character. The Dalmatian architect had doubtless seen
Gothic work in Italy, but “had failed to grasp the idea of receding
orders in the arch, or consistent mouldings in his tracery.”268 The
columns with their caps and bases are of a severely antique
character. But in spite of all deviations from architectural orthodoxy
this cloister, set off by cherry and orange trees and evergreen
shrubs, is, after the Franciscan cloister, one of the loveliest monastic
buildings in Dalmatia.
The secular buildings, with one notable exception, belong to a later
period. The exception is the Sponza269 or custom house, a large part
of which was built in the early fourteenth century. It stands at the
end of the Stradone, opposite the Piazza and the church of San
Biagio, and consists of three stories built round a courtyard. The
ground floor and first floor were probably built in the first years of
the thirteenth century.270 The top story, the façade, and the portico
belong to the fifteenth and sixteenth centuries. The oblong courtyard
is surrounded on the lower story by vaulted arcades of round arches
with square soffits supported on short plain solid octagonal columns,
without bases (like those of the Ducal Palace at Venice), and short
capitals opening out into square abaci. The second story is also
arcaded, and has twice as many window openings as the lower story
has arches, round at the two ends and pointed on the sides, with
square piers over the columns below and round columns over the
centres of the arches; their capitals are adorned with foliage, some à
crochet, and some with deflected leaves at the angles. According to
Jackson, all this part is of the same period, in spite of the fact that
some of the openings are round and some pointed. The general
effect is one of extreme simplicity and sobriety; it is, as Jackson says
truly, “an admirable piece of plain, useful, and not ungraceful
architecture, not too showy for the commonplace purposes of the
building, and yet well proportioned and carefully built.”271 Round the
courtyard are the various warehouses, over the doors of which are
the names of different saints. Above the end arch is the inscription:
—
FALLERE NRA VETANT ET FALLI PONDERA MEQ.
PONDERO CVM MERCES PONDERAT IPSE DEVS.
The early work ends with the moulded stringcourse above the
second story; the third story, which has plain square windows, bears
the date 1520 and the monogram , found on so many houses in
Ragusa, to commemorate the earthquake of that year. The façade
has a portico of five handsome round arches in the Renaissance
style, the columns of which are adorned with elaborate capitals;
many of these have been renewed. Above is a row of windows in the
purest Venetian style of the fifteenth century. The central window is
a three-light aperture, the two side ones are of a single light. The
windows of the third story are square like those looking on the
courtyard. In the centre is a niche with a statue of St. Blaize, while
the row of pinnacles on the roof call to mind many a Venetian
palazzo. In spite of all incongruities the Sponza is a very attractive
building, full of quaint grace and good work.
It has many interesting associations with Ragusan history. It was
here that the caravans about to start on their perilous journeys
through the wild Balkan lands formed up, and those which arrived at
Ragusa first stopped. Every bale of goods arriving at or departing
from the city, by sea or land, had to be first examined at the Sponza,
where the proper amount of duty was assessed and paid. All
business was transacted at or around this building. To this day it
serves as a custom-house, and still forms a picturesque background
for the crowds of peasants and traders from all parts of Dalmatia,
the Herzegovina, Montenegro, and Albania who congregate here on
market days, although the traffic has declined both in bulk and in
value since the palmy days of the Republic. The first floor was used
in later years for literary and learned societies and entertainments.
The second floor was the mint.
Of the Castello no traces now remain, its place having been taken by
the Rector’s Palace, with which we shall deal later on. The buildings
we have described were almost the only stone edifices in the town.
All the rest, including the convent of the Clarisse, founded in 1290,
were of timber.272 Ragusa was in great part destroyed by fire in
1292, and rebuilt shortly afterwards, mostly of wood, as before. In a
Reformatio of 1320 the Government published a decree against the
excessive use of timber in construction. But the city was improving
in various ways. The streets were wider and more regular, and stone
steps were built on either side of the Stradone to make the higher
quarters more accessible. Elaborate rules were issued to ensure the
solidity of the roofs and chimneys, and by 1355 the town was paved
with brick.273 The steep streets on the seaward ridge and on the
eight slopes of Monte Sergio began to assume their present aspect,
although but few details of fourteenth-century domestic architecture
have remained. There are several houses in the Venetian Gothic
style, but these were built during the Hungarian occupation, the
artistic influence of Venice outlasting her political suzerainty.
Of the plastic arts we find as yet only slight beginnings, but we may
mention a few early paintings in the Dominican church. A large
crucifix in the Byzantine style, which hangs over the choir arch, was
vowed during the black death of 1348. In the sacristy there is a
polyptych in ten sections, with the Baptism of Christ in the centre of
the lower row, and St. Michael, St. Nicholas, St. Blaize, and St.
Stephen; the Virgin, with St. Peter, St. Dominic, St. Peter Martyr, and
St. Francis above. The work is very primitive; but if it be by a local
master, it is probably of a later date than the style suggests. The
robes are very rich and profusely gilt, but the effect is garish rather
than brilliant, although restoration may perhaps be responsible for
this. A Byzantine Madonna and Child in red is in the same church
between the nave and the transept.
In the city records there are occasional entries alluding to the
engagement of painters, and in 1344 a certain Magister Bernardus
was commissioned to paint the new hall of the communal palace,
which he was to decorate “pomis et stellis auratis.” No trace of this
work has survived.
An interesting piece of sculpture is the bas-relief of St. Blaize on a
wall near the Porta Ploce. The figure is seen in profile, and carries a
crozier with a Lamb in the crook. It is somewhat stiff and Oriental in
pose, but full of character. Curiously enough, it is the only really
good statue of the city’s patron saint at Ragusa. Other images may
be seen over the gates, on the fortifications, and on various
buildings, but they are all colourless and of very rough workmanship.
A plaque of marble, with figures in high relief, in the sacristy of the
Franciscan church, deserves notice. It is said to be thirteenth-
century work of the Isola di Mezzo.
During the next two hundred years architecture attains to its full
development, and at least one painter arises whose work is of
considerable value, while the goldsmith’s and silversmith’s art come
to occupy an important place.
CHAPTER VII
B
Y the treaty of 1358 the whole eastern shore of the Adriatic as
far as Durazzo was ceded to Hungary, but as a matter of fact
that Power only extended its occupation as far as Ragusa. Not
having a strong fleet, King Louis feared that the more southern cities
would be difficult to hold, and he therefore never exercised his
treaty rights over them. Venice, having lost with Dalmatia her chief
naval base, turned her attention towards Albania and the adjoining
Slavonic countries. She had at one time occupied Durazzo (1205-
1208), and through her colonies in Dalmatia had come into contact
with the Albanians. Now that her influence in the former country was
destroyed, and that she had lost a large part of her mainland
possessions, the population devoted itself to “the bee-like task of
accumulating wealth and extending its commerce.”274 Relations
were once more established with Albania, trade with that country
was encouraged, and the foundations were laid for the revival of
Venetian influence in the Adriatic.275
The conditions of the Slavonic states behind Dalmatia were at this
time extremely disturbed. During the brilliant reign of Stephen
Dušan, the Servian people were at the height of their greatness and
power. Macedonia, Albania, and other parts of the Greek Empire,
and a part of Bosnia, as well as Servia proper, acknowledged the rule
of the Servian Tsar, and even Bulgaria paid him tribute. The great
position of Servia under this ruler is not usually appreciated by
historians of the Eastern Empire. Dušan, as Professor Bury
observes,276 was not only a great warrior, but a great legislator, and
drew up the Zakonik or code of laws, comparable with that of
Jaroslav for Russia. Had he lived a few years longer, and been able
to crush the turbulence of his feudal vassals and consolidate his
possessions, Kossovo might never have taken place, and the Balkans
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com