Practical Database Programming With Visual C#.NET [1 ed.] 0470467274, 9780470467275

A novel approach to developing and applying databases with Visual C#.NET Practical Database Programming with Visual C#.N

1,346 195 16MB

English Pages 920 Year 2010

Report DMCA / Copyright

DOWNLOAD FILE

Practical Database Programming With Visual C#.NET [1 ed.]
 0470467274, 9780470467275

Table of contents :
Team rebOOk ......Page 0
Contents......Page 4
Preface......Page 20
Acknowledgment......Page 22
1 Introduction......Page 23
Target Audience......Page 24
Topics Covered......Page 25
Organization of the Book and How to Use It......Page 27
How to Use the Source Code and Sample Databases......Page 28
Instructor and Customer Support......Page 29
Homework Solutions......Page 30
2 Introduction to Databases......Page 32
2.1.1 File Processing System......Page 33
2.1.2 Integrated Databases......Page 34
2.2 Develop a Database......Page 35
2.3 Sample Database......Page 36
2.3.2 Entity-Relationship Model (ER)......Page 39
2.4.3 Foreign Keys and Referential Integrity......Page 40
2.5.1 Connectivity......Page 41
2.6 ER Notation......Page 44
2.7 Data Normalization......Page 45
2.7.2 Second Normal Form (2NF)......Page 46
2.7.3 Third Normal Form (3NF)......Page 47
2.8.1 Microsoft Access Databases......Page 49
2.8.2 SQL Server Databases......Page 50
2.8.2.2 Tables......Page 51
2.8.2.5 Keys and Relationships......Page 52
2.8.3 Oracle Databases......Page 53
2.8.3.4 Stored Procedures......Page 54
2.8.3.5 Indexes......Page 55
2.8.3.9 Password Files......Page 56
2.9.1 Create LogIn Table......Page 57
2.9.2 Create Faculty Table......Page 59
2.9.3 Create Other Tables......Page 61
2.9.4 Create Relationships Among Tables......Page 63
2.10 Create Microsoft SQL Server 2005 Sample Database......Page 67
2.10.1 Create LogIn Table......Page 69
2.10.2 Create Faculty Table......Page 71
2.10.3 Create Other Tables......Page 72
2.10.4.1 Create Relationship Between LogIn and Faculty Tables......Page 77
2.10.4.3 Create Relationship Between Faculty and Course Tables......Page 80
2.10.4.4 Create Relationship Between Student and StudentCourse Tables......Page 81
2.10.4.5 Create Relationship Between Course and StudentCourse Tables......Page 83
2.11 Create Oracle 10g XE Sample Database......Page 84
2.11.1 Create Oracle User Database......Page 85
2.11.2 Add New Data Tables into Oracle User Database......Page 86
2.11.2.1 Create LogIn Table......Page 87
2.11.2.2 Create Faculty Table......Page 93
2.11.2.3 Create Other Tables......Page 96
2.11.3 Create Constraints Between Tables......Page 99
2.11.3.1 Create Constraints Between LogIn and Faculty Tables......Page 101
2.11.3.2 Create Constraints Between LogIn and Student Tables......Page 102
2.11.3.4 Create Constraints Between StudentCourse and Student Tables......Page 104
2.11.3.5 Create Constraints Between StudentCourse and Course Tables......Page 105
2.12 Chapter Summary......Page 107
Homework......Page 108
3.1 ADO and ADO.NET......Page 111
3.2 Overview of ADO.NET 2.0......Page 112
3.3 Architecture of ADO.NET 2.0......Page 113
3.4.1 Data Provider......Page 115
3.4.1.1 ODBC Data Provider......Page 116
3.4.1.3 SQL Server Data Provider......Page 117
3.4.2 Connection Class......Page 118
3.4.2.1 Open() Method of Connection Class......Page 120
3.4.2.2 Close() Method of Connection Class......Page 121
3.4.3 Command and Parameter Classes......Page 122
3.4.3.2 Constructors and Properties of Parameter Class......Page 123
3.4.3.3 Parameter Mapping......Page 124
3.4.3.4 Methods of ParameterCollection Class......Page 126
3.4.3.5 Constructor of Command Class......Page 127
3.4.3.6 Methods of Command Class......Page 128
3.4.4.2 Properties of DataAdapter Class......Page 131
3.4.4.3 Methods of DataAdapter Class......Page 132
3.4.4.4 Events of DataAdapter Class......Page 133
3.4.5 DataReader Class......Page 134
3.4.6 DataSet Component......Page 137
3.4.6.1 DataSet Constructor......Page 138
3.4.6.4 DataSet Events......Page 139
3.4.7 DataTable Component......Page 142
3.4.7.1 DataTable Constructor......Page 143
3.4.7.3 DataTable Methods......Page 144
3.4.7.4 DataTable Events......Page 145
3.4.8 ADO.NET 3.5 Entity Framework......Page 147
3.4.8.1 ADO.NET 3.5 Entity Data Model......Page 149
3.4.8.2 Using ADO.NET 3.5 Entity Data Model Wizard......Page 152
3.5 Chapter Summary......Page 162
Homework......Page 164
4.1 Overview of Language-Integrated Query......Page 167
4.1.1.1 IEnumerable and IEnumerable Interfaces......Page 168
4.1.1.2 IQueryable and IQueryable Interfaces......Page 169
4.1.2 Standard Query Operators......Page 170
4.1.3 Deferred Standard Query Operators......Page 172
4.1.4 Nondeferred Standard Query Operators......Page 176
4.2 Introduction to LINQ Query......Page 178
4.3 Architecture and Components of LINQ......Page 181
4.3.1 Overview of LINQ to Objects......Page 182
4.3.3 Overview of LINQ to SQL......Page 183
4.3.4 Overview of LINQ to Entities......Page 184
4.4 LINQ to Objects......Page 185
4.4.1 LINQ and ArrayList......Page 186
4.4.2 LINQ and Strings......Page 187
4.4.2.1 Query a String to Determine Number of Numeric Digits......Page 188
4.4.2.2 Sort Lines of Structured Text by Any Field in Line......Page 189
4.4.3 LINQ and File Directories......Page 191
4.4.3.1 Query Contents of Files in a Folder......Page 192
4.4.4 LINQ and Reflection......Page 195
4.5 LINQ to DataSet......Page 196
4.5.1 Operations to DataSet Objects......Page 197
4.5.1.1 Query Expression Syntax......Page 198
4.5.1.2 Method-Based Query Syntax......Page 199
4.5.1.3 Query the Single Table......Page 202
4.5.1.4 Query the Cross Tables......Page 203
4.5.1.5 Query Typed DataSet......Page 206
4.5.2 Operations to DataRow Objects Using Extension Methods......Page 209
4.5.3 Operations to DataTable Objects......Page 213
4.6 LINQ to SQL......Page 214
4.6.1 LINQ to SQL Entity Classes and DataContext Class......Page 215
4.6.2 LINQ to SQL Database Operations......Page 219
4.6.2.2 Data Insertion Query......Page 221
4.6.2.3 Data Updating Query......Page 222
4.6.2.4 Data Deletion Query......Page 224
4.7 LINQ to Entities......Page 226
4.7.2 ObjectContext Component......Page 227
4.7.4 LINQ to Entities Flow of Execution......Page 228
4.7.5 Implementation of LINQ to Entities......Page 230
4.8.1 LINQ to XML Class Hierarchy......Page 231
4.8.2.1 Creating XML from Scratch......Page 232
4.8.2.2 Insert XML......Page 234
4.8.2.3 Update XML......Page 235
4.8.3 Manipulate XML Attributes......Page 236
4.8.3.3 Delete XML Attributes......Page 237
4.8.4 Query XML with LINQ to XML......Page 238
4.8.4.2 XML Query Extensions......Page 239
4.8.4.3 Using Query Expressions with XML......Page 240
4.8.4.5 Mixing XML and Other Data Models......Page 241
4.9 C# 3.0 Language Enhancement for LINQ......Page 242
4.9.1 Lambda Expressions......Page 243
4.9.2 Extension Methods......Page 245
4.9.3 Implicitly Typed Local Variables......Page 246
4.9.4 Query Expressions......Page 247
4.10 Chapter Summary......Page 248
Homework......Page 250
5 Data Selection Query with Visual C#.NET......Page 254
5.1 Completed Sample Database Application Example......Page 255
5.2.1 Data Design Tools in Toolbox Window......Page 258
5.2.1.1 DataSet......Page 259
5.2.1.2 DataGridView......Page 260
5.2.1.4 BindingNavigator......Page 261
5.2.2 Data Design Wizards in Data Source Window......Page 262
5.2.2.2 Data Source Configuration Wizard......Page 263
5.2.2.3 DataSet Designer......Page 268
5.3.1 Application User Interfaces......Page 270
5.3.1.1 LogIn Form......Page 271
5.3.1.2 Selection Form......Page 274
5.3.1.3 Faculty Form......Page 275
5.3.1.5 Student Form......Page 276
5.4.1 Add and Configure a New Data Source......Page 278
5.5 Query and Display Data Using the DataGridView Control......Page 282
5.5.1 View Entire Table......Page 283
5.5.2 View Each Record or Specified Columns......Page 285
5.6 Use DataSet Designer to Edit the Structure of DataSet......Page 287
5.7 Bind Data to Associated Controls in LogIn Form......Page 290
5.8 Develop Codes to Query Data Using Fill() Method......Page 293
5.9 Use Return a Single Value to Query Data for LogIn Form......Page 295
5.10 Coding for Selection Form......Page 299
5.11 Bind Data to Associated Controls in Faculty Form......Page 301
5.12 Develop Codes to Query Data from Faculty Table......Page 303
5.12.1 Develop Codes to Query Data Using SQL SELECT Method......Page 304
5.12.2 Develop Codes to Query Data Using LINQ Method......Page 306
5.13 Display Pictures for Faculty Form......Page 307
5.14 Binding Data to Associated Controls in Course Form......Page 310
5.15.1 Query Data from the Course Table Using TableAdapter Method......Page 314
5.15.2 Query Data from the Course Table Using LINQ Method......Page 316
5.16.1 Create a New Visual C# Project—SelectWizardOracle......Page 318
5.16.2 Select and Add Oracle Database 10g XE as Data Source......Page 319
PART II Data Query with Runtime Objects......Page 322
5.17 Introduction to Runtime Objects......Page 323
5.17.1 Procedure of Building a Data-Driven Application Using Runtime Objects......Page 325
5.18.1.1 Declare Runtime Objects......Page 326
5.18.1.2 Connect to Data Source with Runtime Objects......Page 327
5.18.1.3 Coding for Method 1: Using DataSet–DataAdapter to Query Data......Page 329
5.18.1.4 Coding for Method 2: Using DataReader to Query Data......Page 331
5.18.2 Coding for Selection Form......Page 333
5.18.3 Query Data Using Runtime Objects for Faculty Form......Page 335
5.18.4 Query Data Using Runtime Objects for Course Form......Page 343
5.18.5.1 Coding for Constructor of Student Form......Page 354
5.18.5.2 Coding for Student Select Button Click Method......Page 355
5.19 Query Data Using Runtime Objects to SQL Server Database......Page 363
5.19.1 Migrating from Access to SQL Server and Oracle Databases......Page 364
5.19.2 Query Data Using General Runtime Objects......Page 367
5.19.2.1 Query Data Using the General Runtime Objects for LogIn Form......Page 368
5.19.2.3 Query Data Using General Runtime Objects for Faculty Form......Page 374
5.19.2.4 Query Data Using General Runtime Objects for Course Form......Page 377
5.19.2.5 Retrieve Data from Multiple Tables Using Joined Tables Method......Page 379
5.19.2.6 Query Data Using General Runtime Objects for Student Form......Page 383
5.19.2.7 Query Data Using Stored Procedures......Page 385
5.19.3 Query Data Using LINQ to SQL Technique......Page 405
5.19.3.2 Query Data Using LINQ to SQL for LogIn Form......Page 407
5.19.3.3 Coding for Selection Form......Page 410
5.19.3.4 Query Data Using LINQ to SQL for Faculty Form......Page 412
5.19.3.5 Query Data Using Joined LINQ to SQL for Course Form......Page 416
5.19.3.6 Query Data Using LINQ to SQL Stored Procedures for Student Form......Page 420
5.20.1 Oracle Database 10g Express Edition Release 2......Page 424
5.20.2 Configure Oracle Database Connection String......Page 425
5.20.3 Query Data Using General Runtime Objects......Page 426
5.20.3.1 Query Data Using General Runtime Objects for LogIn Form......Page 427
5.20.3.2 Coding for Selection Form......Page 432
5.20.3.3 Query Data Using Runtime Objects for Faculty Form......Page 433
5.20.3.4 Query Data Using Runtime Objects for Course Form......Page 436
5.20.3.5 Stored Procedures in Oracle Database Environment......Page 438
5.20.3.7 Syntax of Creating a Package in Oracle......Page 439
5.20.3.8 Create Faculty_Course Package for Course Form......Page 441
5.20.3.9 Query Data Using Oracle Package for Course Form......Page 445
5.21 Chapter Summary......Page 451
Homework......Page 453
6 Data Inserting with Visual C#.NET......Page 458
6.1 Insert New Data into a Database......Page 459
6.1.1 Insert New Records into a Database Using TableAdapter.Insert Method......Page 460
6.2 Insert Data into Microsoft Access Database Using Sample Project InsertWizard......Page 461
6.2.3 Create Insert Faculty Form Window......Page 462
6.2.4 Duplicate Visual C#.NET Projects with Installed DataSet......Page 464
6.2.5 Validate Data Before Data Insertion......Page 465
6.2.5.2 Validate Data Using Generic Collection......Page 466
6.2.6 Initialization and Termination Coding for Data Insertion......Page 470
6.2.7.1 Configure TableAdapter and Build Data Inserting Query......Page 472
6.2.8 Develop Codes to Insert Data Using TableAdapter.Insert Method......Page 474
6.2.9 Develop Codes to Insert Data Using TableAdapter.Update Method......Page 476
6.2.10.1 Modifications to Faculty Form Window......Page 481
6.2.10.2 Modifications to Insert Faculty Form Window......Page 484
6.3 Insert Data into SQL Server Database Using Sample Project SQLInsertWizard......Page 487
6.3.1 Modify Existing Project to Get New Data Insertion Project......Page 488
6.3.2 Create New Form Window to Insert Data for Course Form......Page 489
6.3.3 Trigger and Connect to Visual Studio Design Tools......Page 491
6.3.4 Project Initialization and Validate Data Before Data Insertion......Page 492
6.3.5 Configure TableAdapter and Build Data Insertion Query......Page 495
6.3.6 Develop Codes to Insert Data Using TableAdapter.Insert Method......Page 496
6.3.7 Develop Codes to Insert Data Using TableAdapter.Update Method......Page 500
6.3.8 Use Select Button in Course Form to Perform Data Validation......Page 503
6.3.9.1 Create Stored Procedure Using TableAdapter Query Configuration Wizard......Page 504
6.3.9.2 Modify Codes to Perform Data Insertion Using Stored Procedure......Page 506
PART II Data Insertion with Runtime Objects......Page 508
6.5 General Runtime Objects Method......Page 509
6.6.1 Add Inserting Data Form Window: Insert Faculty Form......Page 510
6.6.2 Modify Codes to Copied Project......Page 512
6.6.3 Startup Coding and Data Validation Before Data Insertion......Page 513
6.6.4 Insert Data into Faculty Table......Page 517
6.6.5 Validate Data After Data Insertion......Page 521
6.6.5.1 Modifications to Faculty Form Window......Page 522
6.6.5.2 Insert New Faculty Photo......Page 524
6.6.5.3 Modifications to Insert Faculty Form Window......Page 525
6.7.1 Modifications to Namespaces......Page 529
6.7.2 Remove SP Form and Student Form......Page 530
6.7.3 Modify Database Connection String......Page 531
6.7.4 Modify LogIn Query Strings......Page 533
6.7.6 Modifications to Other Forms......Page 534
6.8 Insert Data into Oracle Database Using Runtime Objects......Page 537
6.8.1 Add Oracle Reference and Oracle Namespace......Page 538
6.8.2 Modify Project Namespaces......Page 539
6.8.3 Modify Database Connection String......Page 540
6.8.4 Modify LogIn Query Strings......Page 541
6.8.5 Modify Faculty Query String......Page 542
6.8.6 Modifications to Other Forms......Page 544
6.9 Insert Data into Database Using LINQ Queries......Page 545
6.10.1 Insert Data into SQL Server Database Using Stored Procedures......Page 546
6.10.1.1 Add an Inserting Data Form Window: Insert Course Form......Page 547
6.10.1.2 Develop Stored Procedures of SQL Server Database......Page 548
6.10.1.3 Develop Codes to Call Stored Procedures to Insert Data into Course Table......Page 551
6.10.2 Insert Data into Oracle Database Using Stored Procedures......Page 557
6.10.2.1 Develop Stored Procedures in Oracle Database......Page 558
6.10.2.2 Develop Codes to Call Stored Procedures to Insert Data into Course Table......Page 562
6.11 Chapter Summary......Page 566
Homework......Page 567
7 Data Updating and Deleting with Visual C#.NET......Page 570
PART I Data Updating and Deleting with Visual Studio.NET Design Tools and Wizards......Page 571
7.1.1 Updating and Deleting Data in Related Tables in DataSet......Page 572
7.1.3 Update or Delete Data in Database Using TableAdapter.Update Method......Page 573
7.2 Update and Delete Data for Microsoft Access Database......Page 574
7.2.2 Application User Interfaces......Page 575
7.2.2.2 Bind Data for All Textboxes of Faculty Form Window......Page 576
7.2.4.1 Build Data Updating Query Function......Page 577
7.2.4.2 Build Data Deleting Query Function......Page 578
7.2.5 Develop Codes to Update Data Using TableAdapter DBDirect Method......Page 579
7.2.5.2 Updating Coding......Page 580
7.2.6 Develop Codes to Update Data Using TableAdapter.Update Method......Page 581
7.2.7 Develop Codes to Delete Data Using TableAdapter DBDirect Method......Page 583
7.2.8 Develop Codes to Delete Data Using TableAdapter.Update Method......Page 584
7.2.9 Validate Data After Data Updating and Deleting......Page 585
7.3 Update and Delete Data for SQL Server Database......Page 587
7.5 Runtime Objects Method......Page 591
7.6.1 Update Data in Faculty Table for SQL Server Database......Page 593
7.6.1.1 Modify Faculty Form Window......Page 594
7.6.1.2 Modify Original Coding in Faculty Form......Page 595
7.6.1.3 Develop Codes to Update Data......Page 596
7.6.2.1 Develop Codes to Delete Data......Page 598
7.6.2.2 Validate Data Updating and Deleting......Page 600
7.7 Update and Delete Data for Oracle Databases Using Runtime Objects......Page 603
7.7.2.2 Modify SELECT Query String in TabLogIn Button Click Method......Page 604
7.7.3.2 Modify UPDATE Query String for Update Button Click Method......Page 605
7.7.4.2 Modify SELECT Query String for CourseList Click Method......Page 606
7.7.5 Other Modifications......Page 607
7.8 Update and Delete Data in Database Using Stored Procedures......Page 608
7.8.1.1 Modify Existing Project......Page 609
7.8.1.2 Create Stored Procedures in Microsoft Access Database......Page 611
7.8.1.3 Call Stored Procedure to Update Faculty Information......Page 613
7.8.1.4 Call Stored Procedure to Delete Faculty Information......Page 614
7.8.2.1 Modify Existing Project to Create New Project......Page 617
7.8.2.2 Develop Stored Procedure in SQL Server Database......Page 620
7.8.2.3 Call Stored Procedure to Perform Data Updating and Deleting......Page 624
7.8.3 Update and Delete Data in Oracle Database Using Stored Procedures......Page 625
7.8.3.1 Modify Existing Project to Create New Project......Page 626
7.8.3.2 Develop Stored Procedure in Oracle Database......Page 629
7.8.3.3 Call Stored Procedures to Perform Data Updating and Deleting......Page 633
7.9 Update and Delete Data in Databases Using LINQ to SQL Query......Page 634
7.9.1 Create New Object of DataContext Class......Page 635
7.9.2 Develop Codes for Select Button Click Method......Page 636
7.9.3 Develop Codes for Update Button Click Method......Page 637
7.9.4 Develop Codes for Delete Button Click Method......Page 639
Homework......Page 640
8 Accessing Data in ASP.NET......Page 644
8.1 What Is .NET Framework?......Page 645
8.2 What Is ASP.NET and ASP.NET 3.5?......Page 646
8.2.1 ASP.NET Web Application File Structure......Page 648
8.2.3 What Really Happens When a Web Application Is Executed?......Page 649
8.2.4 Requirements to Test and Run a Web Project......Page 650
8.3 Develop ASP.NET Web Application to Select Data from SQL Server Databases......Page 652
8.3.1 Create the User Interface—LogIn Form......Page 653
8.3.2 Develop Codes to Access and Select Data from Database......Page 654
8.3.3 Validate Data on Client Side......Page 658
8.3.4 Create Second User Interface—Selection Page......Page 659
8.3.5 Develop Codes to Open Other Page......Page 660
8.3.6 Create Third User Interface—Faculty Page......Page 662
8.3.7.1 Develop Codes for Page_Load Method......Page 664
8.3.7.2 Develop Codes for Select Button Method......Page 665
8.3.7.3 Develop Codes for Other Methods......Page 667
8.3.8 Create Fourth User Interface—Course Page......Page 670
8.3.8.1 AutoPostBack Property of Listbox Control......Page 672
8.3.9 Develop Codes to Select Desired Course Information......Page 673
8.3.9.1 Coding for Course Page Loading and Ending Methods......Page 674
8.3.9.2 Coding for Select Button Click Method......Page 675
8.3.9.3 Coding for SelectedIndexChanged Method of Listbox Control......Page 677
8.3.9.4 Coding for Other User-Defined Methods......Page 678
8.4 Develop ASP.NET Web Application to Insert Data into SQL Server Databases......Page 680
8.4.1 Create New Web Page Insert.aspx......Page 681
8.4.2 Develop Codes to Perform Data Insertion Function......Page 682
8.4.4 Develop Codes for Insert Button Click Method......Page 683
8.4.5 Develop Codes for Other Methods......Page 685
8.4.6 Validate Data Insertion......Page 687
8.5 Develop Web Applications to Update and Delete Data in SQL Server Databases......Page 690
8.5.2 Modify Coding for Faculty Page......Page 691
8.5.3 Develop Codes for Update Button Click Method......Page 693
8.5.4.1 Relationships Between Five Tables in Our Sample Database......Page 697
8.5.4.3 Use Cascade Deleting Option to Simplify Data Deleting......Page 698
8.5.4.4 Develop Codes to Perform Data Deleting......Page 700
8.6 Develop ASP.NET Web Applications with LINQ to SQL Query......Page 702
8.6.1 Create New Web Form Page......Page 703
8.6.2 Create New Object of DataContext Class......Page 704
8.6.3 Coding for Data Selection Query......Page 706
8.6.4 Coding for Data Insertion Query......Page 707
8.6.5 Coding for Data Updating and Deleting Queries......Page 708
8.7 Develop ASP.NET Web Application to Select Data from Oracle Databases......Page 711
8.7.1 Modify Connection String and Connection Object on LogIn Page......Page 712
8.7.2 Modify Query String in LogIn Page......Page 713
8.7.3 Modify Query String in Faculty Page......Page 714
8.7.4 Modify Query Strings in Course Page......Page 715
8.8 Develop ASP.NET Web Application to Insert Data into Oracle Databases......Page 719
8.8.2 Modify Codes to Some Methods on Faculty Page......Page 720
8.8.3 Create Codes to Insert New Faculty on Faculty Page......Page 723
8.9.1.1 Create Codes to Update Button Click Method......Page 727
8.9.2 Develop Stored Procedures to Perform Data Deleting......Page 729
8.9.2.1 Delete Existing Record from Faculty Table......Page 730
8.9.2.2 Develop Codes for Delete Button Click Method......Page 731
8.9.2.3 Validate Data Deleting Action......Page 732
8.9.2.4 Constraint Property—On Delete Cascade in Data Table......Page 734
8.10 Chapter Summary......Page 736
Homework......Page 737
9 ASP.NET Web Services......Page 740
9.1 Web Services and Their Components......Page 741
9.2 Procedures to Build a Web Service......Page 742
9.2.2 Real Considerations When Building a Web Service Project......Page 743
9.2.3 Procedures to Build an ASP.NET Web Service......Page 744
9.3.1 Files and Items Created in the New Web Service Project......Page 745
9.3.2 Feeling of Hello World Web Service Project as It Runs......Page 748
9.3.3 Modify Default Web Service Project......Page 751
9.3.4 Create a Base Class to Handle Error Checking for Our Web Service......Page 753
9.3.5 Create Real Web Service Class......Page 754
9.3.6 Add Web Methods into Our Web Service Class......Page 755
9.3.7.1 Web Service Connection Strings......Page 756
9.3.7.2 Modify Existing Web Method......Page 759
9.3.7.3 Develop Codes to Perform Database Queries......Page 760
9.3.7.4 Develop Codes for User-Defined Methods......Page 762
9.3.8.1 Develop Stored Procedure WebSelectFacultySP......Page 765
9.3.8.2 Add Another Web Method to Call the Stored Procedure......Page 766
9.3.9 Use DataSet as Returning Object for Web Method......Page 767
9.3.10 Build Windows-Based Web Service Clients to Use the Web Services......Page 770
9.3.10.1 Create a Web Service Proxy Class......Page 771
9.3.10.2 Develop Graphic User Interface for Windows-Based Client Project......Page 773
9.3.10.3 Develop Code to Use the Web Service......Page 774
9.3.11 Build Web-Based Web Service Clients to Use the Web Service......Page 781
9.3.11.2 Add a Web Service Reference and Modify the Web Form Window......Page 782
9.3.11.3 Modify Codes for Related Methods......Page 783
9.3.12 Deploy the Completed Web Service to Production Servers......Page 788
9.3.12.1 Copy Web Service Files to Virtual Directory......Page 789
9.3.12.2 Publish Precompiled Web Service......Page 790
9.4 Build ASP.NET Web Service Project to Insert Data into SQL Server Database......Page 791
9.4.1 Modify Existing Web Service Project......Page 792
9.4.3 Develop and Modify Codes for Code-Behind Page......Page 793
9.4.3.1 Develop and Modify First Web Method SetSQLInsertSP......Page 794
9.4.3.2 Develop Second Web Method GetSQLInsert......Page 798
9.4.3.3 Develop and Modify Third Web Method SQLInsertDataSet......Page 801
9.4.3.4 Develop Fourth Web Method GetSQLInsertCourse......Page 807
9.4.4 Build Windows-Based Web Service Clients to Use Web Services......Page 811
9.4.5.1 Create a New Website Project and Add Existing Web Page......Page 812
9.4.5.2 Add Web Service Reference and Modify Web Form Window......Page 813
9.4.5.3 Modify Codes for Related Methods......Page 814
9.5 Build ASP.NET Web Service to Update and Delete Data for SQL Server Database......Page 824
9.5.2 Modify Related Web Methods......Page 826
9.5.2.1 Modify Web Method from SetSQLInsertSP to SQLUpdateSP......Page 827
9.5.2.2 Modify Web Method GetSQLInsert to GetSQLCourse......Page 829
9.5.2.3 Modify Web Method GetSQLInsertCourse to GetSQLCourseDetail......Page 830
9.5.2.4 Add New Web Method SQLDeleteSP......Page 832
9.5.3.1 Develop Stored Procedure WebUpdateCourseSP......Page 834
9.5.3.2 Develop Stored Procedure WebDeleteCourseSP......Page 836
9.7 Build Web-Based Web Service Clients to Use Web Services......Page 846
9.7.2 Add Web Service Reference and Modify Web Form Window......Page 847
9.7.3 Modify Codes for Related Methods......Page 848
9.7.3.2 Develop Codes for Update Button’s Click Method......Page 849
9.7.3.3 Develop Codes for Delete Button’s Click Method......Page 851
9.7.3.4 Modify Codes in Select Button’s Click Method and Related Methods......Page 852
9.7.3.5 Modify Codes in SelectedIndexChanged Method......Page 854
9.8 Build ASP.NET Web Service Project to Access Oracle Database......Page 857
9.8.1 Build Web Service Project WebServiceOracleSelect......Page 858
9.8.3 Modify Namespace Directories......Page 859
9.8.4 Modify Web Method GetSQLSelect and Related Methods......Page 860
9.8.5.1 Modifications to Stored Procedure WebSelectFacultySP......Page 862
9.8.5.2 Modifications to Codes in Web Method GetSQLSelectSP......Page 866
9.8.6 Modify Web Method GetSQLSelectDataSet......Page 867
9.10 Build ASP.NET Web Service Project to Insert Data into Oracle Database......Page 873
9.10.2 Modify Connection String......Page 874
9.10.4 Modify Web Method SetSQLInsertSP and Related Methods......Page 875
9.10.5 Modify Web Method GetSQLInsert and Related Methods......Page 877
9.10.6 Modify Web Method SQLInsertDataSet......Page 879
9.10.7 Modify Web Method GetSQLInsertCourse and Related Methods......Page 881
9.11 Build Web Service Clients to Use Web Service WebServiceOracleInsert......Page 890
9.12 Build ASP.NET Web Service to Update and Delete Data for Oracle Database......Page 891
9.12.2 Modify Connection String......Page 892
9.12.4 Modify Web Method SQLUpdateSP and Related Methods......Page 893
9.12.4.1 Develop Stored Procedure UpdateCourse_SP......Page 896
9.12.5 Modify Web Method GetSQLCourse and Related Methods......Page 898
9.12.6 Modify Web Method GetSQLCourseDetail and Related Methods......Page 900
9.12.7 Modify Web Method SQLDeleteSP......Page 902
9.12.7.1 Develop Stored Procedure WebDeleteCourseSP......Page 904
9.12.7.2 Implement and Test Web Service Project......Page 906
9.13 Build Web Service Clients to Use Web Service......Page 908
9.14 Chapter Summary......Page 909
Homework......Page 910
Index......Page 913

Polecaj historie