John Wiley & Sons SQL Server Database Programming with Visual Basic.NET Cover A guide to the practical issues and applications in database programming with updated Visual Basic.N.. Product #: 978-1-119-60850-9 Regular price: $74.19 $74.19 In Stock

SQL Server Database Programming with Visual Basic.NET

Concepts, Designs and Implementations

Bai, Ying

Cover

1. Edition July 2020
688 Pages, Softcover
Handbook/Reference Book

ISBN: 978-1-119-60850-9
John Wiley & Sons

Buy now

Price: 77,90 €

Price incl. VAT, excl. Shipping

Further versions

epubmobipdf

A guide to the practical issues and applications in database programming with updated Visual Basic.NET

SQL Server Database Programming with Visual Basic.NET offers a guide to the fundamental knowledge and practical techniques for the design and creation of professional database programs that can be used for real-world commercial and industrial applications. The author--a noted expert on the topic--uses the most current version of Visual Basic.NET, Visual Basic.NET 2017 with Visual Studio.NET 2017. In addition, he introduces the updated SQL Server database and Microsoft SQL Server 2017 Express. All sample program projects can be run in the most updated version, Visual Basic.NET 2019 with Visual Studio.NET 2019.

Written in an accessible, down-to-earth style, the author explains how to build a sample database using the SQL Server management system and Microsoft SQL Server Management Studio 2018. The latest version of ASP.NET, ASP.NET 4.7, is also discussed to provide the most up-to-date Web database programming technologies. This important book:
* Offers illustrative practical examples and detailed descriptions to aid in comprehension of the material presented
* Includes both fundamental and advanced database programming techniques
* Integrates images into associated database tables using a DevExpress UI tools -WindowsUI

Written for graduate and senior undergraduate students studying database implementations and programming courses, SQL Server Database Programming with Visual Basic.NET shows how to develop professional and practical database programs in Visual Basic.NET 2017/Visual Basic.NET 2019.

About the Author xix

Preface xxi

Acknowledgment xxiii

About the Companion Website xxiv

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

Chapter 2 Introduction to Databases 9
Ying Bai and Satish Bhalla

2.1 What are Databases and Database Programs? 10

2.1.1 File Processing System 10

2.1.2 Integrated Databases 11

2.2 Develop a Database 12

2.3 Sample Database 13

2.3.1 Relational Data Model 13

2.3.2 Entity-Relationship Model (ER) 17

2.4 Identifying Keys 18

2.5 Define Relationships 18

2.6 ER Notation 22

2.7 Data Normalization 23

2.7.1 First Normal Form (1NF) 23

2.7.2 Second Normal Form (2NF) 24

2.7.3 Third Normal Form (3NF) 26

2.8 Database Components in Some Popular Databases 28

2.8.1 Microsoft Access Databases 28

2.8.2 SQL Server Databases 29

2.8.3 Oracle Databases 32

2.9 Create Microsoft SQL Server 2017 Express Sample Database 35

2.9.1 Create the LogIn Table 36

2.9.2 Create the Faculty Table 37

2.9.3 Create Other Tables 39

2.9.4 Create Relationships Among Tables 45

2.9.4.1 Create Relationship Between the LogIn and the Faculty Tables 46

2.9.4.2 Create Relationship Between the LogIn and the Student Tables 49

2.9.4.3 Create Relationship Between the Faculty and the Course Tables 50

2.9.4.4 Create Relationship Between the Student and the StudentCourse Tables 50

2.9.4.5 Create Relationship Between the Course and the StudentCourse Tables 51

2.9.5 Store Images to the SQL Server 2017 Express Database 53

2.10 Chapter Summary 61

Homework 63

Chapter 3 Introduction to ADO.NET 67

3.1 The ADO and ADO.NET 67

3.2 Overview of the ADO.NET 69

3.3 The Architecture of the ADO.NET 70

3.4 The Components of ADO.NET 71

3.4.1 The Data Provider 72

3.4.1.1 The ODBC Data Provider 73

3.4.1.2 The OLEDB Data Provider 73

3.4.1.3 The SQL Server Data Provider 74

3.4.1.4 The Oracle Data Provider 74

3.4.2 The Connection Class 74

3.4.2.1 The Open() Method of the Connection Class 77

3.4.2.2 The Close() Method of the Connection Class 77

3.4.2.3 The Dispose() Method of the Connection Class 78

3.4.3 The Command and the Parameter Classes 78

3.4.3.1 The Properties of the Command Class 79

3.4.3.2 The Constructors and Properties of the Parameter Class 79

3.4.3.3 Parameter Mapping 80

3.4.3.4 The Methods of the ParameterCollection Class 82

3.4.3.5 The Constructor of the Command Class 83

3.4.3.6 The Methods of the Command Class 84

3.4.4 The DataAdapter Class 87

3.4.4.1 The Constructor of the DataAdapter Class 87

3.4.4.2 The Properties of the DataAdapter Class 87

3.4.4.3 The Methods of the DataAdapter Class 88

3.4.4.4 The Events of the DataAdapter Class 88

3.4.5 The DataReader Class 90

3.4.6 The DataSet Component 92

3.4.6.1 The DataSet Constructor 94

3.4.6.2 The DataSet Properties 94

3.4.6.3 The DataSet Methods 94

3.4.6.4 The DataSet Events 94

3.4.7 The DataTable Component 97

3.4.7.1 The DataTable Constructor 98

3.4.7.2 The DataTable Properties 98

3.4.7.3 The DataTable Methods 99

3.4.7.4 The DataTable Events 100

3.4.8 ADO.NET Entity Framework 102

3.4.8.1 Advantages of Using the Entity Framework 6 104

3.4.8.2 The ADO.NET 4.3 Entity Data Model 106

3.4.8.3 Using Entity Framework 6 Entity Data Model Wizard 110

3.5 Chapter Summary 118

Homework 120

Chapter 4 Introduction to Language Integrated Query (LINQ) 123

4.1 Overview of Language Integrated Query 123

4.1.1 Some Special Interfaces Used in LINQ 124

4.1.1.1 The IEnumerable and IEnumerable(Of T) Interfaces 124

4.1.1.2 The IQueryable and IQueryable(Of T) Interfaces 125

4.1.2 Standard Query Operators 126

4.1.3 Deferred Standard Query Operators 127

4.1.4 Non-Deferred Standard Query Operators 131

4.2 Introduction to LINQ Query 135

4.3 The Architecture and Components of LINQ 137

4.3.1 Overview of LINQ to Objects 138

4.3.2 Overview of LINQ to DataSet 139

4.3.3 Overview of LINQ to SQL 139

4.3.4 Overview of LINQ to Entities 140

4.3.5 Overview of LINQ to XML 140

4.4 LINQ to Objects 141

4.4.1 LINQ and ArrayList 142

4.4.2 LINQ and Strings 143

4.4.2.1 Query a String to Determine the Number of Numeric Digits 144

4.4.2.2 Sort Lines of Structured Text By any Field in the Line 145

4.4.3 LINQ and File Directories 147

4.4.3.1 Query the Contents of Files in a Folder 148

4.4.4 LINQ and Reflection 150

4.5 LINQ to DataSet 152

4.5.1 Operations to DataSet Objects 152

4.5.1.1 Query Expression Syntax 153

4.5.1.2 Method-Based Query Syntax 154

4.5.1.3 Query the Single Table 157

4.5.1.4 Query the Cross Tables 159

4.5.1.5 Query Typed DataSet 162

4.5.2 Operations to DataRow Objects Using the Extension Methods 165

4.5.3 Operations to DataTable Objects 169

4.6 LINQ to SQL 170

4.6.1 LINQ to SQL Entity Classes and DataContext Class 171

4.6.1.1 Add LINQ to Data Reference 171

4.6.1.2 Add LINQ To SQL Tools 171

4.6.2 LINQ to SQL Database Operations 175

4.6.2.1 Data Selection Query 175

4.6.2.2 Data Insertion Query 177

4.6.2.3 Data Updating Query 178

4.6.2.4 Data Deletion Query 179

4.6.3 LINQ to SQL Implementations 182

4.7 LINQ to Entities 182

4.7.1 The Object Services Component 183

4.7.2 The ObjectContext Component 183

4.7.3 The ObjectQuery Component 184

4.7.4 LINQ to Entities Flow of Execution 184

4.7.5 Implementation of LINQ to Entities 186

4.8 LINQ to XML 187

4.8.1 LINQ to XML Class Hierarchy 187

4.8.2 Manipulate XML Elements 188

4.8.2.1 Creating XML from Scratch 188

4.8.2.2 Insert XML 190

4.8.2.3 Update XML 191

4.8.2.4 Delete XML 192

4.8.3 Manipulate XML Attributes 192

4.8.3.1 Add XML Attributes 192

4.8.3.2 Get XML Attributes 193

4.8.3.3 Delete XML Attributes 193

4.8.4 Query XML with LINQ to XML 194

4.8.4.1 Standard Query Operators and XML 194

4.8.4.2 XML Query Extensions 195

4.8.4.3 Using Query Expressions with XML 196

4.8.4.4 Using XPath and XSLT with LINQ to XML 196

4.8.4.5 Mixing XML and Other Data Models 197

4.9 Visual Basic.NET Language Enhancement for LINQ 199

4.9.1 Lambda Expressions 199

4.9.2 Extension Methods 201

4.9.3 Implicitly Typed Local Variables 205

4.9.4 Query Expressions 206

4.10 Chapter Summary 208

Homework 209

Chapter 5 Data Selection Query with Visual Basic.NET 215

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

5.1 A Completed Sample Database Application Example 216

5.2 Visual Studio.NET Design Tools and Wizards 219

5.2.1 Data Components in the Toolbox Window 220

5.2.1.1 The DataSet 220

5.2.1.2 DataGridView 221

5.2.1.3 BindingSource 222

5.2.1.4 BindingNavigator 222

5.2.1.5 TableAdapter 223

5.2.1.6 TableAdapter Manager 223

5.2.2 Data Source Window 223

5.2.2.1 Add New Data Sources 224

5.2.2.2 Data Source Configuration Wizard 224

5.2.2.3 DataSet Designer 228

5.3 Query Data from SQL Server Database Using Design Tools and Wizards 231

5.3.1 Application User Interface 231

5.3.1.1 The LogIn Form 232

5.3.1.2 The Selection Form 232

5.3.1.3 The Faculty Form 232

5.3.1.4 The Course Form 234

5.3.1.5 The Student Form 234

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

5.4.1 Query and Display Data using the DataGridView and Detail Controls 236

5.4.1.1 View the Entire Table 238

5.4.1.2 View Each Record or the Specified Columns with Detail View 241

5.4.2 Use DataSet Designer to Edit the Structure of the DataSet 243

5.4.3 Bind Data to the Associated Controls in LogIn Form 245

5.4.4 Develop Codes to Query Data Using the Fill() Method 249

5.4.5 Use Return a Single Value to Query Data for LogIn Form 251

5.4.6 Develop the Codes for the Selection Form 254

5.4.7 Query Data from the Faculty Table for the Faculty Form 256

5.4.8 Develop Codes to Query Data from the Faculty Table 258

5.4.8.1 Develop Codes to Query Data Using the TableAdapter Method 258

5.4.8.2 Develop Codes to Query Data Using the LINQ to DataSet Method 261

5.4.9 Query Data from the Course Table for the Course Form 262

5.4.9.1 Build the Course Queries Using the Query Builder 263

5.4.9.2 Bind Data Columns to the Associated Controls in the Course Form 265

5.4.9.3 Develop Codes to Query Data for the Course Form 267

Part II Data Query with Runtime Objects 271

5.5 Introduction to Runtime Objects 272

5.5.1 Procedure of Building a Data-Driven Application Using Runtime Object 274

5.6 Query Data from SQL Server Database Using Runtime Object 274

5.6.1 Access to SQL Server Database 274

5.6.2 Declare Global Variables and Runtime Objects 276

5.6.3 Query Data Using Runtime Objects for the LogIn Form 278

5.6.3.1 Connect to the Data Source with the Runtime Object 278

5.6.3.2 Coding for Method 1: Using the TableAdapter to Query Data 279

5.6.3.3 Coding for Method 2: Using the DataReader to Query Data 281

5.6.4 The Coding for the Selection Form 283

5.6.5 Query Data Using Runtime Objects for the Faculty Form 284

5.6.5.1 Using Three Query Methods to Retrieve Images from SQL Server Database 290

5.6.6 Query Data Using Runtime Objects for the Course Form 290

5.6.6.1 Retrieve Data from Multiple Tables Using Tables JOINS 293

5.6.7 Query Data Using Runtime Objects for the Student Form 301

5.6.7.1 Query Student Data Using Stored Procedures 302

5.6.7.2 Query Data Using Stored Procedures for Student Form 306

5.6.7.3 Query Data Using More Complicated Stored Procedures 315

5.7 Chapter Summary 320

Homework 321

Chapter 6 Data Inserting with Visual Basic.NET 327

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

6.1 Insert Data Into a Database 328

6.1.1 Insert New Records into a Database Using the TableAdapter.Insert Method 329

6.1.2 Insert New Records into a Database Using the TableAdapter.Update Method 329

6.2 Insert Data into the SQL Server Database Using a Sample Project InsertWizard 330

6.2.1 Create InsertWizard Project Based on the SelectWizard Project 330

6.2.2 Application User Interfaces 331

6.2.3 Validate Data Before the Data Insertion 331

6.2.3.1 Visual Basic Collection and .NET Framework Collection Classes 331

6.2.3.2 Validate Data Using the Generic Collection 332

6.2.4 Initialization Coding Process for the Data Insertion 335

6.2.5 Build the Insert Query 336

6.2.5.1 Configure the TableAdapter and Build the Data Inserting Query 336

6.2.6 Develop Codes to Insert Data Using the TableAdapter.Insert Method 337

6.2.7 Develop Codes to Insert Data Using the TableAdapter.Update Method 341

6.2.8 Insert Data into the Database Using the Stored Procedures 345

6.2.8.1 Create the Stored Procedure Using the TableAdapter Query Configuration Wizard 346

6.2.8.2 Modify the Codes to Perform the Data Insertion Using the Stored Procedure 346

Part II Data Insertion with Runtime Objects 350

6.3 The General Run Time Objects Method 351

6.4 Insert Data into the SQL Server Database Using the Run Time Object Method 352

6.4.1 Insert Data into the Faculty Table for the SQL Server Database 353

6.4.1.1 Validate Data Before the Data Insertion 353

6.4.1.2 Insert Data into the Faculty Table 355

6.4.1.3 Validate Data After the Data Insertion 357

6.5 Insert Data into the Database Using Stored Procedures 360

6.5.1 Insert Data into the SQL Server Database Using Stored Procedures 360

6.5.1.1 Develop Stored Procedures in SQL Server Database 361

6.5.1.2 Develop Codes to Call Stored Procedures to Insert Data into the Course Table 363

6.6 Insert Data into the Database Using the LINQ To SQL Method 368

6.6.1 Insert Data Into the SQL Server Database Using the LINQ to SQL Queries 369

6.7 Chapter Summary 369

Homework 370

Chapter 7 Data Updating and Deleting with Visual Basic.NET 377

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

7.1 Update or Delete Data Against Databases 378

7.1.1 Updating and Deleting Data from Related Tables in a DataSet 379

7.1.2 Update or Delete Data Against Database Using TableAdapter DBDirect Methods - TableAdapter.Update and TableAdapter.Delete 379

7.1.3 Update or Delete Data Against Database Using TableAdapter.Update Method 380

7.2 Update and Delete Data For Microsoft SQL Server Database 381

7.2.1 Create a New Project Based on the InsertWizard Project 381

7.2.2 Application User Interfaces 382

7.2.3 Validate Data Before the Data Updating and Deleting 382

7.2.4 Build the Update and Delete Queries 382

7.2.4.1 Configure the TableAdapter and Build the Data Updating Query 383

7.2.4.2 Build the Data Deleting Query 384

7.2.5 Develop Codes to Update Data Using the TableAdapter DBDirect Method 385

7.2.5.1 Modifications of the Codes 385

7.2.5.2 Creations of the Codes 385

7.2.6 Develop Codes to Update Data Using the TableAdapter.Update Method 387

7.2.7 Develop Codes to Delete Data Using the TableAdapter DBDirect Method 388

7.2.8 Develop Codes to Delete Data Using the TableAdapter.Update Method 390

7.2.9 Validate the Data After the Data Updating and Deleting 391

Part II Data Updating and Deleting with Runtime Objects 395

7.3 The Run Time Objects Method 395

7.4 Update and Delete Data for SQL Server Database Using the Run Time Objects 396

7.4.1 Update Data Against the Faculty Table in the SQL Server Database 397

7.4.1.1 Develop Codes to Update the Faculty Data 397

7.4.1.2 Validate the Data Updating 399

7.4.2 Delete Data from the Faculty Table in the SQL Server Database 399

7.4.2.1 Develop Codes to Delete Data 399

7.4.2.2 Validate the Data Deleting 401

7.5 Update and Delete Data against SQL Server Database Using Stored Procedures 404

7.5.1 Modify an Existing Project to Create Our New Project 405

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

Chapter 8 Accessing Data in ASP.NET 429

8.1 What is .NET Framework? 430

8.2 What is ASP.NET? 431

8.2.1 ASP.NET Web Application File Structure 433

8.2.2 ASP.NET Execution Model 433

8.2.3 What is Really Happened When a Web Application is Executed? 434

8.2.4 The Requirements to Test and Run the Web Project 435

8.3 Develop ASP.NET Web Application to Select Data from SQL Server Databases 435

8.3.1 Create the User Interface - LogIn Form 436

8.3.2 Develop the Codes to Access and Select Data from the Database 438

8.3.3 Validate the Data in the Client Side 442

8.3.4 Create the Second User Interface - Selection Page 443

8.3.5 Develop the Codes to Open the Other Page 444

8.3.6 Modify the Codes in the LogIn Page to Transfer to the Selection Page 446

8.3.7 Create the Third User Interface - Faculty Page 447

8.3.8 Develop the Codes to Select the Desired Faculty Information 448

8.3.8.1 Develop the Codes for the Page_Load Event Procedure 449

8.3.8.2 Develop the Codes for the Select Button Click Event Procedure 450

8.3.8.3 Develop the Codes for Other Procedures 452

8.3.9 Create the Fourth User Interface - Course Page 454

8.3.9.1 The AutoPostBack Property of the List Box Control 457

8.3.10 Develop the Codes to Select the Desired Course Information 457

8.3.10.1 Coding for the Course Page Loading and Ending Event Procedures 458

8.3.10.2 Coding for the Select Button's Click Event Procedure 459

8.3.10.3 Coding for the SelectedIndexChanged Event Procedure of the CourseList Box 461

8.3.10.4 Coding for Other User Defined Subroutine Procedures 463

8.4 Develop ASP.NET Web Application to Insert Data Into SQL Server Databases 465

8.4.1 Develop the Codes to Perform the Data Insertion Function 466

8.4.2 Develop the Codes for the Insert Button Click Event Procedure 466

8.4.3 Validate the Data Insertion 473

8.5 Develop Web Applications to Update and Delete Data in SQL Server Databases 473

8.5.1 Modify the Codes for the Faculty Page 474

8.5.2 Develop the Codes for the Update Button Click Event Procedure 475

8.5.3 Develop the Codes for the Delete Button Click Event Procedure 479

8.5.3.1 Relationships Between Five Tables in Our Sample Database 480

8.5.3.2 Data Deleting Sequence 481

8.5.3.3 Use the Cascade Deleting Option to Simplify the Data Deleting 481

8.5.3.4 Create the Stored Procedure to Perform the Data Deleting 483

8.5.3.5 Develop the Codes to Call the Stored Procedure to Perform the Data Deleting 486

8.6 Develop ASP.NET Web Applications with LINQ to SQL Query 489

8.6.1 Create a New Object of the DataContext Class 491

8.6.2 Develop the Codes for the Data Selection Query 492

8.6.3 Develop the Codes for the Data Insertion Query 493

8.6.4 Develop the Codes for the Data Updating and Deleting Queries 496

8.7 Chapter Summary 500

Homework 500

Chapter 9 ASP.NET Web Services 505

9.1 What are Web Services and Their Components? 506

9.2 Procedures to Build a Web Service 508

9.2.1 The Structure of a Typical Web Service Project 508

9.2.2 The Real Considerations When Building a Web Service Project 509

9.2.3 Introduction to Windows Communication Foundation (WCF) 509

9.2.3.1 What is the WCF? 510

9.2.3.2 WCF Data Services 510

9.2.3.3 WCF Services 511

9.2.3.4 WCF Clients 511

9.2.3.5 WCF Hosting 512

9.2.3.6 WCF Visual Studio Templates 512

9.2.4 Procedures to Build an ASP.NET Web Service 513

9.3 Build ASP.NET Web Service Project to Access SQL Server Database 514

9.3.1 Files and Items Created in the New Web Service Project 515

9.3.2 A Feeling of the Hello World Web Service Project As it Runs 518

9.3.3 Modify the Default Namespace 520

9.3.4 Create a Base Class to Handle Error Checking for Our Web Service 522

9.3.5 Create a Customer Returned Class to Hold All Retrieved Data 522

9.3.6 Add Web Methods into Our Web Service Class 524

9.3.7 Develop the Codes for Web Methods to Perform the Web Services 524

9.3.7.1 Web Service Connection Strings 524

9.3.7.2 Modify the Existing HelloWorld Web Method 527

9.3.7.3 Develop the Codes to Perform the Database Queries 528

9.3.7.4 Develop the Codes for Subroutines Used in the Web Method 530

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

9.7 Build Web-Based Web Service Clients to Consume the Web Services 624

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
Ying Bai, PhD, is a Professor in the Department of Computer Science and Engineering at Johnson C. Smith University (JCSU). He has published multiple books with Wiley-IEEE Press including Practical Microcontroller Engineering with ARM Technology, Practical Database Programming with Visual C#.NET and Practical Database Programming with Java.

Y. Bai, Johnson C. Smith University, Charlotte, NC