Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Pro CSharp And The .NET 2.0 Platform (2005) [eng]

.pdf
Скачиваний:
111
Добавлен:
16.08.2013
Размер:
10.35 Mб
Скачать

954 CHAPTER 25 UNDERSTANDING XML WEB SERVICES

official UDDI website can be found at http://uddi.microsoft.com. The official website of UDDI (http://www.uddi.org) provides numerous white papers and SDKs that allow you to build internal UDDI servers.

Interacting with UDDI via Visual Studio 2005

Recall that the Add Web Reference dialog box allows you not only to obtain a list of all XML web services located on your current development machine (as well as a well-known URL) but also to submit queries to UDDI servers. Basically, you have the following options:

Browse for a UDDI server on your company intranet.

Browse the Microsoft-sponsored UDDI production server.

Browse the Microsoft-sponsored UDDI test server.

Assume that you are building an application that needs to discover the current weather forecast on a per–zip code basis. Your first step would be to query a UDDI catalog with the following question:

• “Do you know of any web services that pertain to weather data?”

If it is the case that the UDDI server has a list of weather-aware web services, you are returned a list of all registered URLs that export the functionality of your query. Referencing this list, you are able to pick the specific web service you wish to communicate with and eventually obtain the WSDL document that describes the functionality of the weather-centric functionality.

As a quick example, create a brand-new console application project and activate the Add Web Reference dialog box. Next, select the Test Microsoft UDDI Directory link, which will bring you to the Microsoft UDDI test server. At this point, enter weather as a search criterion. Once the UDDI catalog has been queried, you will receive a list of all relevant XML web services. When you find an XML web service you are interested in programming against, add a reference to your current project. As you would expect, the raw WSDL will be parsed by the tool to provide you with a C# proxy.

Note Understand that the UDDI test center is just that: a test center. Don’t be too surprised if you find a number of broken links. When you query production-level UDDI servers, URLs tend to be much more reliable, given that companies typically need to pay some sort of fee to be listed.

Summary

This chapter exposed you to the core building blocks of .NET web services. The chapter began by examining the core namespaces (and core types in these namespaces) used during web service development. As you learned, web services developed using the .NET platform require little more than applying the [WebMethod] attribute to each member you wish to expose from the XML web service type. Optionally, your types may derive from System.Web.Services.WebService to obtain access to the Application and Session properties (among other things). This chapter also examined three key related technologies: a lookup mechanism (UDDI), a description language (WSDL), and a wire protocol (GET, POST, or SOAP).

Once you have created any number of [WebMethod]-enabled members, you can interact with a web service through an intervening proxy. The wsdl.exe utility generates such a proxy, which can be used by the client like any other C# type. As an alternative to the wsdl.exe command-line tool, Visual Studio 2005 offers similar functionality via the Add Web Reference dialog box.

Index

Special Characters

#elif, preprocessor directive, 317–18 #else, preprocessor directive, 317–18 #endif, preprocessor directive, 317–18 #endregion, preprocessor directive, 317 #if, preprocessor directive, 317–18 #region, preprocessor directive, 317 #undef, preprocessor directive, 317–19 & operator, pointer types, 312–13

* operator, pointer types, 312–13 ?? operator, 133

+= operator, 610

<%@Page%> directive, ASP.NET, 846 <%Import%> directive, ASP.NET, 846–47 ? suffix, nullable types, 131

A

A# programming language, 8 Abort( ) method, Thread type, 460

abstract base classes contrasted with interfaces, 224

abstract classes, 16, 164–65, 166 abstract members (interface), 221 abstract methods, 166–69

AcceptChanges( ), RejectChanges( ) methods, ADO.NET, 795–98

AcceptsReturn property, Textbox, 705 access modifiers, 76–78

Add Reference dialog box, 356, 359–60 AddCacheDependency( ) method, ASP.NET

HTTP Response, 860 adding controls, ASP.NET, 869–70

AddRange( ) method, ControlCollection, 702 ADO.NET

additional namespaces, 763–64 vs. ADO classic, 759–60

application configuration files, 769–70 asynchronous data access, 792–93 autogenerated data components, 824–25 autogenerating SQL commands, 816–17 autoincrementing, 797

binding DataTables to user interfaces, 804, 806 Command object, 781–82

connected layer, 778

connected vs. disconnected layer, 760 connecting to database, Visual Studio 2005,

776

connection objects, 779–80 ConnectionStringBuilder object, 780–81 connectionStrings element, application

configuration, 774–75

data adapter objects, 811–12 data providers overview, 759–62 data wizards, 822–25 DataColumn objects, 796, 798 DataRelation objects, 817–20 DataRow objects, 798–99, 801

DataRow.RowState property, 799–800 DataSet class, 794–96

datasets in XML web services, 950 DataTable objects, 800 DataTableReader objects, 802 DataView objects, 810 DbDataReader object, 782–83 definition, 759–60

deleting records, 787 deleting rows, 806–7 disconnected layer, 793 example database, 775

example, data provider factory, 772–74 filling DataSet, 812

filters, 807–8

Firebird Interbase data provider, 763

IBM DB2 Universal Database data providers, 763

IDbCommand interface, 766 IDbConnection interface, 765 IDbDataAdapter, IDataAdapter interface, 767 IDbDataParameter, IDataParameter

interface, 766

IDbDataReader, IDataReader interface, 767–68

IDbTransaction interface, 765 inserting records, 786 mapping DBMS names, 813

Microsoft data providers, 762–63 modifying tables, Command object, 784–86 multiple result sets, DbDataReader object,

784

multitabled DataSet objects, 817–20 MySQL data providers, 763

navigating between related tables, 820–21 overview, 759

parameterized command objects, 788 persisting datasets as XML, 803 PostgreSQL providers, 763

provider factory model, 770–72 sort order, 807–8

specifying DbParameter parameters, 788–90 stored procedures using DbCommand,

790–91

strongly typed datasets, 823–24

955

956 I N D E X

System.Data, 764

third-party data providers, 763 updating records, 787 updating rows, 809

updating using data adapter objects, 813–15 using interfaces, 768–69

view objects, 810

AdRotator example, ASP.NET, 874

AllKeys property, ASP.NET HttpApplicationState members, 898

AllowDBNull property, ADO.NET DataColumn object, 796

AnchorStyles enumeration values, 755 animation in controls, 743 anonymous methods

description, 282 example, 283–84

App_Browsers, ASP.NET 2.0 subdirectories, 851 App_Code, ASP.NET 2.0 subdirectories, 851, 853 App_Data, ASP.NET 2.0 subdirectories, 851 App_GlobalResources, ASP.NET 2.0

subdirectories, 851 App_LocalResources, ASP.NET 2.0 subdirectories, 851

App_Themes, ASP.NET 2.0 subdirectories, 851 App_WebReferences, ASP.NET 2.0

subdirectories, 851 AppDomains

advantages, 435

creation example code, 437 loading example code, 438

manipulation example code, 436–37 overview, 425

relationship to processes, 435 thread relationship, 449 unloading example code, 439–40

AppendText( ) method, FileInfo class, System.IO, 526, 528–29

Application, ASP.NET HttpApplication members, 897

application cache, ASP.NET, 901 Application class

ApplicationExit event, 609 CompanyName property, 609 DoEvents( ) method, 609 EnableVisualStyles( ) method, 609 ExecutablePath property, 609 Exit( ) method, 609

Idle event, 609 ProductName property, 609 ProductVersion property, 609 StartupPath property, 609 ThreadExit event, 609

Application class, System.Windows.Forms, 606 application configuration files, ADO.NET,

769–70 application development

cordbg.exe debugger, 33, 40–41 csc.exe compiler, 33–36

.NET 2.0 Framework SDK, general guide, 33

notepad.exe development editor, 33 overview, 33

SharpDevelop, 33

TextPad development editor, 41 Visual C# 2005 Express, 33

application domain, garbage collection, 188 application level state data, ASP.NET, 898–99 Application, Page Type properties, 856 Application property, WebService base class,

929

application root categories, 182–83 application shutdown, ASP.NET, 900 Application_End( ), Global.asax event handlers

in ASP.NET, 896

Application_Error( ), Global.asax event handlers in ASP.NET, 896

Application_Start( ), Global.asax event handlers in ASP.NET, 896

ApplicationExit event, Application class, 609 ApplicationId, RemotingConfiguration, 580 ApplicationName, RemotingConfiguration, 580 applications vs. sessions, ASP.NET, 897 appSetting element, Web.config, ASP.NET, 912 array types, 127–28

ArrayList System.Collections class type, 250–51 arrays

jagged, 129–30 multidimensional, 128

as parameters and return values, 128 using interface types in, 228

in XML web services, 949 as keyword

determining interface support, 225 determining type, 172

ASP.NET

<%@Page%> directive, 846 <%Import%> directive, 846–47 adding and removing controls, 869–70 AdRotator example, 874 AutoEventWireUp attribute, 862–63 AutoPostBack property, 866

browser statisics in HTTP Request processing, 858

categories of web controls, 871–72 classic ASP, 838, 840

client-side scripting, 836

client-side scripting example, 836–37 code-behind, description, 842 code-behind page model, 847–49 compilation cycle

multifile pages, 854–55 single-file pages, 853–54 debugging and tracing, 849–50

default.aspx content page example, 875–76 detailed content page example, 881–83 Document Object Model (DOM), 836 Emitting HTML, 860

enumerating controls with Panel control, 867–68

Error event, 863–64

I N D E X 957

form control declarations, 847

assemblies

GET and POST, 837–38

Add Reference dialog box, 356, 359–60

HTML

app.config file, 368

document structure, 833

binary code reuse, 347

form development, 833

CIL code, 351, 358

overview, 832

client application example, 359–60

web controls, 871

CLR file header, 350–51

HTTP

code base config file element, 385, 387

overview, 829–30

code library, 347

Request members, 857

compared with legacy executables, 347

Request processing, 857–59

consuming shared assemblies, 376–77

Response members, 860

cross-language inheritance, 362

Response processing, 859–61

definition, 347

IIS virtual directories, 831

delayed digital signing, 375–76

incoming form data, 858–59

dependentAssembly config file element, 381–82

inheritance chain, page type, 855–56

download cache, 352

in-place editing example, 879–80

dynamic redirection to a specific version,

Internet Information Server (IIS),

381–82

description, 830

embedded resources, 352

inventory content page example, 877–78

example of version updating, 379–82

IsPostBack property in HTTP Request

explicit load request, 366, 368

processing, 859

flow of CLR external reference resolution, 388

life cycle of web page, 861–63, 865

global assembly cache (GAC), 25, 348

master pages example, 872–73

ildasm exploration of manifest, 357

menu control example, 873

implicit load request, 366, 368

overview, 829

internal format, 349

page type inheritance chain, 855–56

language integration, 360, 362, 364–65

redirecting users, 861

manifest, 348, 351, 357

request/response cycle, HTTP, 829

manifest description, 11

round-trips (postbacks), 836

metadata description, 10

runat attribute, 847

module-level manifest, 364

script block, 847

modules, 11, 352

server-side event handling, 865

multifile, 352, 362–65

simple web controls, 871

.NET Framework Configuration utility,

simple website example, 872–75, 877–83

369–70, 382

single file code model, 842–43

netmodule file extension, 352, 362–64

sorting and paging example, 878–79

overview, 10, 347

stateless, description, 830

private, 365–66, 368

submitting form data, 837–38

probing process, 366, 368

System.Web.UI.Control, 866–67, 869–70

publisher policy assemblies, 384–85

System.Web.UI.Page, 856

referencing external, 25

System.Web.UI.WebControls namespace,

and resource files, 693

865–66

satellite assemblies, 352

System.Web.UI.WebControls.WebControl,

self-describing, 348

870

shared assemblies, 371

user interface in HTML, 834–35

configuration, 378–79

using web controls, 865–66

and the GAC, 374

validating form data, 837

shared assembly manifest, 378

validation controls, 883, 885–88

single-file, 352

version 1.x benefits, 840

example, 354–56

version 2.0 benefits, 841

vs. multifile, 11

version 2.0 namespaces overview, 841

strong names, 348, 357, 371, 373–74

web application, description, 830

assigning using Visual Studio 2005, 374

web development server, 832

code example, 373

web page code model, 842–46

type metadata, 348, 351, 358

web server, description, 830

updating applications using shared

WebControl base class properties, 870–71

assemblies, 378–79

website directory structure, 851

version number, 348

ASP.NET 2.0 namespaces, 842

Visual Studio 2005 configuration, 368

ASP.NET 2.0 subdirectories, 851–53

Win32 file header, 349

958I N D E X

Assembly class, System.Reflection, 396, 402–6 assembly directive, common intermediate

language (CIL), 488 assembly manifest, 15

assembly metadata, const values, 81 AssemblyBuilder, System.Reflection.Emit

namespace, 505 AssemblyCompanyAttribute attribute, 415 AssemblyCopyrightAttribute attribute, 415 AssemblyCultureAttribute attribute, 415 AssemblyDescriptionAttribute attribute, 415 AssemblyInfo.cs file, 415 AssemblyKeyFileAttribute attribute, 416 AssemblyLoad event, System.AppDomain, 436 AssemblyName class, System.Reflection

namespace, 396 assembly/namespace/type distinction, 22 AssemblyOperatingSystemAttribute attribute,

416

AssemblyProcessorAttribute attribute, 416 AssemblyProductAttribute attribute, 416 AssemblyRef, 394

AssemblyResolve event, System.AppDomain, 436

AssemblyTrademarkAttribute attribute, 416 AssemblyVersionAttribute attribute, 416 AsyncCallback delegate, multithreaded

applications, 456–57

asynchronous data access, ADO.NET, 792–93 asynchronous delegate call, 260–61 asynchronous I/O, 542–43

asynchronous multithreading using delegates, 260–61

AsyncResult class, multithreaded applications, 457–58

attribute-based programming assembly, module level attributes, 415 attribute key points, 412 AttributeUsage attribute, 414

C# attribute notation, 411 CLSCompliant attribute, 408–9 COM vs. .NET attributes, 408 constructor parameters, 411 custom attributes, 412 description, 408

DllImport attribute, 409 early binding, 416–17

example of custom attributes, 413 extensibility, 418–24

late binding, 417–18 multiple attributes, 410–11 NonSerialized attribute, 409 Obsolete attribute, 408–9, 411 overview, 391

restricting attributes, 414 Serializable attribute, 409 serializing example, 409–10

Visual Basic snap-in example, 420–21 WebMethod attribute, 409

Windows forms example, 421–22

attributes, assembly, module level, 415 Attributes property, FileSystemInfo class, 519,

521

AttributeUsage attribute, 414

authentication element, Web.config, ASP.NET, 912

authorization element, Web.config, ASP.NET, 912

AutoCheck property, Button, 711 AutoEventWireUp attribute, ASP.NET, 862–63 autogenerating SQL commands, ADO.NET,

816–17

AutoIncrementproperty, ADO.NET DataColumn object, 796

autoincrementing, ADO.NET, 797 AutoPostBack property, ASP.NET web controls,

866

B

base keyword in class creation, 156–57 BaseDirectory( ), System.AppDomain, 436 BasePriority, ProcessThread type, 432 BaseStream property, BinaryReader class, 538 BaseStream property, BinaryWriter class, 538 basic string operations, 123–24 BeginCatchBlock( ) method,

System.Reflection.Emit.ILGenerator,

506 BeginExceptionBlock( ) method,

System.Reflection.Emit.ILGenerator,

506 BeginFinallyBlock( ) method,

System.Reflection.Emit.ILGenerator,

506

BeginInvoke( ) method, multithreaded applications, 453–58

BeginInvoke( ) method, SoapHttpClientProtocol class, 944

BeginLabel( ) method, System.Reflection.Emit.ILGenerator, 506

BeginLocal( ) method, System.Reflection.Emit.ILGenerator, 506

BeginScope( ) method, System.Reflection.Emit.ILGenerator, 506

BeginTransaction( ) method, DbConnection, ADO.NET, 779

Bin, ASP.NET 2.0 subdirectories, 851–52 binary code reuse, 347

binary opcodes, 479 BinaryFormatter

deserialization, 551 serialization, 548, 550–51

BinaryReader, BinaryWriter, System.IO, 538–39 BinaryReader, BinaryWriter types,

input/output, System.IO, 517 BinaryReader class, 538

BinaryWriter class, 538

binding DataTables to user interfaces, ADO.NET, 804, 806

binding element, WSDL document elements, 939

boxing and unboxing CIL code, 322

generics issues, 321–22 InvalidCastException, 322

.NET 1.1 solution, 323–24

.NET 2.0 solution, 104–6 BrowsableAttribute, System.ComponentModel,

746

Browser controls, 736–37

browser statisics in HTTP Request processing, ASP.NET, 858

BufferedStream type, input/output, System.IO, 517

bugs, description, 197 Button control

AutoCheck property, 711 CheckAlign property, 711 Checked property, 711 CheckState property, 711 FlatStyle property, 709, 711 Image property, 709 ImageAlign property, 709 TextAlign property, 709 ThreeState property, 711

by value parameter passing, 89–90

C

C language deficiencies, 3 C# benefits and features, 7–8 C++

program structure compared with C#, 65 Cache, Page Type properties, ASP.NET, 856 callback interfaces

event interface, 256–57, 259 overview, 255

sink object, 256–57, 259 two-way conversation, 255

Cancel( ), DbCommand, ADO.NET, 782 CancelAsync( ) method,

SoapHttpClientProtocol class, 944 CanRead, CanSeek, CanWrite, Stream class,

System.IO, 532

CAO activation, remoting, 572–73 Caption property, ADO.NET DataColumn

object, 796

Cars example database, ADO.NET, 775 CaseSensitive property, ADO.NET DataSet class,

795

CaseSensitive property, ADO.NET DataTable object, 800

casting operations, 170–71 CategoryAttribute, System.ComponentModel,

746

CausesValidation, control class property, 730

I N D E X 959

ChangeDatabase( ) method, DbConnection, ADO.NET, 779

channels, remoting, 568–69 CharacterCasing property, Textbox, 705 CheckAlign property, Button, 711 CheckBox AddRange( ) method,

ControlCollection type, 702 CheckBox control, 711, 713 checked compiler flag, 308 checked keyword, 307–9

Checked property, Button, 711 CheckedListBox control, 714–15 CheckState property, Button, 711 child class, description, 146

child controls, System.Windows.Forms, 606 child forms in MDI applications, 647 ChildRelations property, ADO.NET DataTable

object, 800

CIL compiler directives, 478

CIL language and programming, 477–504 CIL overview, 477–78

class

comparison with objects and references, 179 containment/delegation model, 146 definition, 69

instantiation, 72

member variable default values, 78 public interfaces, 144–45

types, 16

class directive, common intermediate language (CIL), 489–90

class library, definition, 347 classic ASP and ASP.NET, 838, 840 Clear( ) method

ADO.NET DataSet class, 795

ASP.NET HttpApplicationState members, 898 ASP.NET HTTP Response, 860 ControlCollection, 702

client and server definitions, 565 client-activated remoting, 590–91

client-side configuration files, remoting, 585–86 client-side representation of XML web services,

952–53

client-side scripting in ASP.NET, 836–37 ClientTarget, Page Type properties, ASP.NET,

856

Clone( ) method, ADO.NET DataSet class, 795 cloneable objects (ICloneable), 238–42 Close( ) method

BinaryReader class, 538 BinaryWriter class, 538 Stream class, System.IO, 532 TextWriter, System.IO, 534

CloseMainWindow( ), System.Diagnostics.Process, 429

CLSCompliant attribute, 408–9 COBOL .NET programming language, 8

code comment XML format characters, 177 code DOM provider, 513

code libraries and assemblies, 347

960 I N D E X

code-behind, description, ASP.NET, 842

mresources directive, 489

code-behind page model, ASP.NET, 847–49

vs. MSIL, 10

CodePage, ASP.NET <%@Page%> directive

namespace directive, 489

attribute, 846

new keyword, 181

collections

opcodes, 479, 495

ICollection interface, 248

overview, 11, 477

IDictionary interface, 248

peverify.exe tool, 487

IDictionaryEnumerator interface, 249

as programming language, 477

IList interface, 249

properties, 494–95

overview, 221

pushing and popping from the stack, 480

CollectionsUtil, System.Collections.Specialized,

round-trip engineering, 481–85

253

saving CIL code using ildasm.exe, 481–83

colon operator, 111

stack-based programming, 480

color values, GDI+, 663

structures, 491

ColorDialog class, GDI+, 664–65

subsystem directive, 489

ColumnMapping property, ADO.NET

token set of CIL, 478

DataColumn object, 796

type constructors, 494

ColumnName property, ADO.NET DataColumn

using ILIDE#, 486

object, 796

using SharpDevelop, 486

Combine( ) method,

variables, local, 498

System.MulticastDelegate/System

virtual execution stack, 480

Delegate, 263

Common Language Runtime (CLR)

ComboBox control, 716–17

file header in assemblies, 350–51

Command object, ADO.NET, 781–82

hosts

Command object, ADO.NET data providers, 761

CLR versions, 446

CommandTimeout, DbCommand, ADO.NET,

dotnetfx.exe, 444

782

multiple .NET Framework versions, 445

common intermediate language (CIL)

.NET assembly activation under Windows

advantages of learning, 477–78

XP, 444–45

assembly directive, 488

overview, 425

attributes, 479

requiredRuntime config specification, 446

benefits, 13

side-by-side execution, 445

binary opcodes, 479

specific CLR version specification, 446

C# vs. VB.NET, 11–12

mscoree.dll, 20

class directive, 489–90

mscorlib.dll, 21

code explained, 482–83

overview, 20

code labels, 483–84

Common Language Specification (CLS), 19–20

compiler flags, 485

Common Type System (CTS)

compiling CIL code, 485–86

adornments, 18

compiling to specific platforms, 14

class types, 16

complete example program, 500–504

delegate types, 17

current object parameter, 499

enumeration types, 17

defining current assembly, 488

interface types, 17

directives, 478

intrinsic types, 18

enums, 491

overview, 15

externally referenced assemblies, 488

structure types, 16

field directive, 493

type members, 18

ilasm.exe compiler, 477

CompanyName property, Application class,

interfaces, 490

609

iteration, 499

comparable objects (IComparable), 242–44

just-in-time (JIT) compiler, 14

CompareExchange( ) method, Interlocked type,

locals directive, 498

multithreaded applications, 472

mapping C# types to CIL types, 492–93

CompareValidator control, ASP.NET, 884, 887

mapping parameters to variables, 498

compilation cycle, ASP.NET 2.0

maxstack directive, 497

multifile pages, 854–55

method parameters, 495

overview, 853

methods, 494–95

single-file pages, 853–54

mnemonics, 479

compilation element, Web.config, ASP.NET, 913

modifying CIL code, 481–85

CompilerOptions, ASP.NET <%@Page%>

module directive, 488

directive attribute, 846

I N D E X 961

compiling common intermediate language

DefaultValue attribute, 747

(CIL), 485–87

Designer.cs file, 702–3

Component Object Model (COM), 5

Dock property, 755–56

concurrency, multithreaded applications, 450,

dynamic positioning, 754

467–71

ErrorBlinkStyle properties, 730

conditional compile, 318–19

ErrorProviders, 729–31

configuration files, remoting, 584

events, 741

configuration inheritance, ASP.NET, 917–18

GroupBox, 711, 713

Configure( ) method, RemotingConfiguration,

image processing, 739–41

580

InitializeComponent( ) method, 703

connected layer, ADO.NET, 778

Label, 704–5

Connection, DbCommand, ADO.NET, 782

ListBox, 715–16

Connection object, ADO.NET data providers,

manually adding controls to forms, 700–701

761

MaskedTextBox, 707, 709

connection objects, ADO.NET, 779–80

mnemonic keys in Label, 704–5

ConnectionStringBuilder object, ADO.NET,

MonthCalendar, 719–21

780–81

node images in TreeViews, 734, 736

connectionStrings element, ADO.NET

overview, 699

application configuration, 774–75

Panel, 726–27

connectionStrings element, Web.config,

properties, 741–44

ASP.NET, 913

RadioButton, 711, 713

ConnectionTimeout( ) method, DbConnection,

tab order, 718

ADO.NET, 779

TabControl, 722–23

const keyword (constant data), 80

table and flow layout, 756–57

Constraints property, ADO.NET DataTable

TabStop, TabIndex properties, 718

object, 800

TextBox, 705–7

ConstructorBuilder, System.Reflection.Emit

ToolTip, 721–22

namespace, 505

TrackBar, 724–26

constructors, 70–71

TreeView, 731–36

containers for ToolStrips, Visual Studio 2005,

UpDown, 727, 729

643, 645

UserControl Test Container, 743

Context property, WebService base class, 929

using custom controls, 744–45

context-agile, 441

WebControl, 736–37

context-bound, 441–42

Controls property, System.Web.UI.Control in

Contraint, System.Data, ADO.NET, 764

ASP.NET, 867

contravariance, delegates, 276

cookies, ASP.NET, 909–10

control class properties, 730

coordinate systems, GDI+, 659–60

control state, state management in ASP.NET, 894

Copy( ) method, ADO.NET DataSet class, 795

ControlCollection, 702

CopyTo( ) method, FileInfo class, System.IO, 526

controls

cordbg.exe command-line debugger, 40–41

adding, using Visual Studio 2005, 702–3

Count, ControlCollection, 702

animation, 743

Count property, ASP.NET HttpApplicationState

ASP.NET, adding and removing, 869–70

members, 898

basic, 703–4

covariance, delegates, 275–76

Button, 709–10

Create( ) method

CheckBox, 711, 713

DirectoryInfo class, 519, 522–23

CheckedListBox, 714–15

FileInfo class, System.IO, 526

ComboBox, 716–17

CreateDomain( ), System.AppDomain, 435, 437

ControlCollection, 701–2

CreateInstance( ), System.AppDomain, 436

custom, 737–43

CreateObjRef( ), System.MarshalByRefObject,

appearance of, 746

572

design time attributes of, 746

CreateSubdirectory( ) method, DirectoryInfo

hosts for, 744–45

class, 519, 522–23

icon, 748–49

CreateText( ) method, FileInfo class, System.IO,

custom events, 741

526, 528–29

custom properties, 741–44

CreationTime property, FileSystemInfo class,

DateTimePicker, 721

519

default input button, 719

csc.exe compiler, 33

DefaultEvent attribute, 748

@ symbol (response files), 39

DefaultProperty attribute, 748

command-line flags, 36

962 I N D E X

compile parameters, 36 configuration, 34–35

/debug command-line flag, 41 default response file (csc.rsp), 40 a first C# application, 36

GAC utility, gacutil.exe, 35 mscorlib.dll, 37

multiple external assemblies, 39 multiple source files, 38–39 /noconfig command-line flag, 40 /nostdlib command-line flag, 37 /out command-line flag, 36 Path, setting, 34–35

reasons for using, 34

/reference command-line flag, 37 referencing external assemblies, using

keyword, 37 response files, 39

/target command-line flag, 36 wildcard character, 38

CurrentContext property, Thread type, 460 CurrentLeaseTime, ILease interface remoting,

593

CurrentPriority, ProcessThread type, 432 CurrentState, ILease interface remoting, 593 CurrentThread property, Thread type, 460–61 custom, 846–47

custom controls, 737–43 design time appearance, 746 hosts, 744–45

custom dialog boxes, 750–52 custom events, 741

custom exceptions, structured exception handling, 209–10

custom namespaces, 133–34 custom properties, 741–44 custom type conversion

CIL special names, 306

conversions among related class types, 301–2 explicit keyword, 302–4

implicit conversions, 301 implicit keyword, 302–6 numerical converstions, 301

custom types in XML web services, 948 custom view states, state management in

ASP.NET, 893–94 CustomAttributeBuilder, System.Reflection.

Emit namespace, 505 customErrors element, Web.config, ASP.NET,

913–15

CustomValidator control, ASP.NET, 884

D

data caching, ASP.NET, 901, 903–5

Data property, System.Exception, 200, 206–7 data providers

abstracting using interfaces, 768–69 asynchronous, .NET 2.0, 792–93 command builder type, 816

core objects, 761

factory pattern, .NET 2.0, 770–74 overview, 759–61

DataAdapter object, ADO.NET data providers, 761

Database property, DbConnection, ADO.NET, 779

DataBind( ) method, System.Web.UI.Control in ASP.NET, 867

DataColumn, ADO.NET, 796–97 DataColumn objects, ADO.NET, 796, 798 DataColumn, System.Data, ADO.NET, 764 DataReader object, ADO.NET data providers,

761

DataRelation objects in multitabled DataSet objects, ADO.NET, 817–20

DataRelation, System.Data, ADO.NET, 764 DataRow objects, ADO.NET, 798–801 DataRow, System.Data, ADO.NET, 764

DataRow.RowState property, ADO.NET, 799–800 DataRowState enumeration values, ADO.NET,

799

DataSet class, ADO.NET, 764, 794–96 DataSetName property, ADO.NET DataSet class,

795

Datasource property, DbConnection, ADO.NET, 779

DataTable class, ADO.NET, 764, 800 DataTableReader objects, ADO.NET, 802 DataTableReader, System.Data, ADO.NET, 764 DataType property, ADO.NET DataColumn

object, 796

DataView class, ADO.NET, 765, 810 DateTimePicker control, 721 DbCommand, ADO.NET, 782 DbConnection, ADO.NET, 779 DbDataAdapter members, 811 DbDataReader object, ADO.NET, 782–83 DbParameter, ADO.NET, 789

DbType property, ADO.NET DbParameter, 789 debug vs release build, 318–19

debugging and tracing, ASP.NET, 849–50 DecimalPlaces property, NumericUpDown, 728 decisions and relational/equality operators,

94–96

Decrement( ) method, Interlocked type, multithreaded applications, 472

deep copy, cloneable objects (ICloneable), 242 default constructor, 70–71

default input button, 719 default keyword, generics, 333

default.aspx content page example, ASP.NET, 875–76

DefaultEvent attribute, controls, 748 DefaultEventAttribute,

System.ComponentModel, 746 DefaultProperty attribute, controls, 748 DefaultPropertyAttribute,

System.ComponentModel, 746 DefaultValue attribute, controls, 747

I N D E X 963

DefaultValue property, ADO.NET DataColumn

Directory type, System.IO, 523–24

object, 796

DirectoryInfo class

DefaultValueAttribute,

Create( ), CreateSubdirectory( ) methods,

System.ComponentModel, 746

519, 522–23

DefaultWsdlHelpGenerator.aspx, 925–26

Delete( ) method, 519

DefineEnum( ) method, ModuleBuilder type,

GetDirectories( ) method, 519

510

GetFiles( ) method, 520–22

DefineResource( ) method, ModuleBuilder type,

MoveTo( ) method, 520

510

Parent property, 520

DefineType( ) method, ModuleBuilder type, 510

Root property, 520

delayed digital signing of assemblies, 375–76

DirectoryName, FileInfo class, System.IO, 526

delegates

dirty windows, Paint event, GDI+, 656

asynchronous call, 260–61

DISCO web service UDDI directory, 921

CIL code for simple example, 264

disconnected layer, ADO.NET, 793

compared with C-style callbacks, 259

DispatchMessage( ) method, remoting

complex example, 270–71

ChannelServices, 579

contravariance, 276

disposable objects

covariance, 275–76

code example, 191

delegate keyword, 259

Dispose( ) method, 191

description, 259

IDisposable interface, 191–93

example, 266–68

disposing Graphics objects, GDI+, 658–59

information in, 259

dll, 485

multicast, 262, 268–70

DLL hell, 5

and multithreaded applications, 451, 453

DllImport attribute, 409

NullReferenceException, 267–68

/doc compiler flag, 177

overview, 255

Dock property, controls, 755–56

as parameters, 271–73, 275

DockStyles enumeration values, 755

simple example, 263–64

Document Object Model (DOM), ASP.NET, 836

synchronous call, 260

documentation of source code, with XML,

type safe, 264–65

175–77

types, 17

DoEvents( ) method, Application class, 609

delegation, description, 160

DomainUnload event, System.AppDomain,

Delete( ) method

436, 439–40

ADO.NET DataRow object, 799

DomainUpDown, 728

DirectoryInfo class, 519

dot operator and references, 180

FileInfo class, System.IO, 526

dotnetfx.exe, .NET runtime deployment, 29

DeleteCommand property in updating,

download cache, 352

ADO.NET, 815

DriveInfo class, System.IO, 517, 524–25

deleting

dynamic assemblies

records, ADO.NET, 787

code DOM provider, 513

rows, ADO.NET, 806–7

ConstructionBuilder example, 511–12

deployment, .NET runtime, 29

definition, 505

derived class, description, 146

emitting a method, 512

DescriptionAttribute,

emitting type and member variables

System.ComponentModel, 746

examples, 510

Designer.cs file, 702–3

overview, 477

detailed content page example, ASP.NET,

vs. static assemblies, 504–5

881–83

using dynamically generated assembly,

developing software, 3–5

512–13

device coordinates, GDI+ coordinate systems,

dynamic loading, 402–3

659–60

dynamic positioning, controls, 754–55

dialog boxes, custom, 750–52

dynamic web service discovery using DISCO,

differences, classes, objects, references, 179

921

digital signatures, and strong names, 371, 373

E

Direction property, ADO.NET DbParameter, 789

directives, compiler, 478

ECMA standardization, .NET Framework, 29

Directory

edit processing members, ADO.NET DataRow

DirectoryInfo types, input/output,

object, 799

System.IO, 517–19

Eiffel .NET programming language, 8

FileInfo class, System.IO, 526