Abort() method
MessageQueueTransaction object, 1121–1122
Thread class, 354
aborting threads, 354
abstract modifier, 117, 125
AcceptSocket() method (QuoteServer class), 1278
access control lists. See ACLs
access modifiers, 94, 97
Account class, 297–299
Accumulate() method
Account class, 298–299
Action generic delegate, 299–300
described, 644
implementing for user-defined aggregates, 644–645
AccumulateIf() method, 300–301
AccumulateSimple() method (Account class), 298
acknowledgement message queues, 1120
ACLs (access control lists)
adding and removing from a file, 1225–1226
namespace for, 1222
reading from a directory, 1224–1225
reading from a file, 1222–1223
Action generic delegate, 299–301
ActionCancelEventArgs class
BusEntity class with, 190–191
Cancel property, 188
code listing, 189
derivation of, 188
Message property, 188
OnAction method, 189–190
using, 190–192
ActionEventHandler delegate, 188
Activator class
CreateInstance() method, 1027, 1028, 1029
GetObject() method, 1027, 1028, 1029, 1030
overview, 1027
activator for .NET Remoting client, 1012
Active Directory
accessing native ADSI objects, 735–736
accessing properties directly by name, 731
Active Directory Domains and Trusts MMC snap-in, 721
Active Directory Sites and Services MMC snap-in, 721
Active Directory Users and Computers MMC snap-in, 721–722
ADSI (Active Directory Service Interfaces), 723–724
ADSI Edit tool, 721, 722–723
architecture, 714–720
authentication, 729
binding, 725–729
cache, 732–733
configuration, 716
creating new objects, 733
data characteristics, 719
defined, 713
domain, 716
domain controllers, 716
domain tree, 717
DSML with, 724, 745–748
features, 714–715
finding message queues, 1103–1104
forest, 717
GC (global catalog), 717–718
getting directory entries, 730–731
hierarchical data organization, 714, 719
multimaster replication, 714, 718
object collections, 731–732
objects, defined, 715
read-mostly access, 719, 736
replication latency, 718
replication notification, 718
replication topology, 714
scheduled replication, 718
schemas, 715, 719–720
searching in, 736–745
security, 714–715
sites, 717
strong typing for objects, 715, 719
System.DirectoryServices namespace, 723, 725
updating directory entries, 734
UserSearch application, 740–745
uses for, 713
Active Directory Service Interfaces. See ADSI
Active Server Pages (ASP)
ASP.NET and, 22, 903
defined, 21
limitations of, 21–22
ActiveX controls in Windows Forms
ActiveX Control Importer for, 1168
ActiveX controls, defined, 1168
creating a Windows Forms application, 1169–1171
ActiveX Data Objects (ADO) versus ADO.NET, 580
Add() method
ArrayList class, 251, 272
Hashtable class, 261
List<T> generic class, 279
SortedList class, 258
AddCulturesToTree() method, 520–522
AddDocument() method
DocumentManager class, 284, 294
PriorityDocumentManager class, 290
AddRange() method (ArrayList class), 252
AddResource() method (ResourceWriter class), 527
address operator for pointers, 207
AddToMessage() method, 323
AddToOutput() method, 319
ADO (ActiveX Data Objects) versus ADO.NET, 580
ADO.NET. See also data binding; DataSet class; event-booking application; viewing .NET data
ADO (ActiveX Data Objects) versus, 580
alias names to database factory objects, 585
calling stored procedures, 594–597
closing database connections, 583, 585–588
commands, defined, 589
CommandType enumeration, 590
constructing commands, 590
converting relational data to XML, 694–696
converting single table data to XML, 689–694
converting XML to ADO.NET data, 696–699
copying a DataSet, 625–626
data access provided for C# by, 25
data reader, 597–600
database authentication, 583, 584
database-specific classes, 581–582
defining a database connection string, 584
deleting database records, 591, 595–596
ensuring resources are released, 585–588
ExecuteNonQuery() method, 591
ExecuteReader() method, 591–592
ExecuteScalar() method, 592–593
ExecuteXmlReader() method, 593–594
executing commands, 590–594
getting a single result from a SQL statement, 592–593
inserting database records, 591, 596–597
isolation level for transactions, 588–589
for key generation with SQL Server, 627–629
managing data and relationships with DataSet class, 600–612
managing database connection strings, 584–585
namespaces for, 580
naming conventions, 629–630
.NET versions and, 582
OLE DB provider with, 597–600
opening database connections, 583
overview, 580–582
persisting DataSet changes, 620–625, 691–692
populating a DataSet, 619–620
reading database records, 591–592, 593–594, 597–600
reading DiffGram XML documents, 699–701
shared classes, 581
for tiered development, 625–627
transactions, 588–589
try...catch...finally blocks for releasing resources, 586, 587–588
updating database records, 591, 594–595
using database connections, 582–589
using statement for releasing resources, 586–587, 588
Web Forms and, 926–939
XML schemas, 612–618
ADSI (Active Directory Service Interfaces)
accessing native objects, 735–736
ADSI Providers, 724
cache, 732–733
defined, 724
namespace for, 723
ADSI Edit tool (Active Directory), 721, 722–723
aggregates
defined, 643
user-defined, 644–645
using AVG aggregate, 643
algorithms
bubble-sorting, 180
for dictionaries, 260, 262–263
sorting, globalization and, 524–525
aliases
to factory objects for databases, 585
for namespaces, 60–61
ampersand (&), as address operator for pointers, 207
AnalyzeType() method, 318–319
anonymous methods
BubbleSorter example, 180–182
defined, 176
defining delegates with, 176
delegateTest example, 176–177
event handlers, 187–188
multicast delegates with, 183–185
rules for, 177
SimpleDelegate example, 177–180
threading and, 353
AppDomain class, 414–416
Append() method (StringBuilder class), 227
AppendFormat() method (StringBuilder class), 231
Application class
EnableVisualStyles method, 785–786
methods and properties, 753
Run() method overloads, 753
application configuration files for assemblies, 450, 453–456
application domains. See also .NET Remoting
AppDomain class for, 414–416
application domain-bound objects, 1031
assemblies and, 413–416
contexts, 1015
processes and, 14–16, 413
remote objects confined to, 1017
for SQL Server 2005 databases, 634
strong data typing in IL and, 14–16
usefulness of, 14
using, 414–416
ApplyResources() method (ResourceManager class), 537
arguments. See parameters
arithmetic operators
overloading, 148, 151–152, 153–155
pointers and, 210–211
table listing, 134
array lists. See also ArrayList class
adding elements, 251, 252
arrays versus, 250
boxing and unboxing and, 272
converting to arrays, 253
copying range of items to new list, 253
dynamic growth of, 250–251
elements as object references, 251
indexers, 251
performance compared to dictionaries, 259
removing elements, 251–253
setting capacity of, 250, 251
ArrayList class. See also array lists
Add() method, 251, 272
AddRange() method, 252
dynamic growth of, 250–251
GetRange() method, 253
instantiating, 250
RemoveAt() method, 251
RemoveRange() method, 252–253
setting capacity of, 250, 251
StringBuilder class compared to, 250
arrays
accessing elements, 58
advantages and disadvantages of, 245
array lists versus, 250
ArraySegment<T> generic struct and, 303–304
as collections, 247–248
converting array lists to, 253
DataGridView control for displaying data, 804–805
finding number of elements in, 58
foreach statements for iterating through items, 54
initializing with specific dimensions, 58
overview, 57–58
pointers to, not allowed, 208
as reference types, 58
square brackets used for, 57
stack-based, using pointers, 219–222
StreamReader class with, 1215–1216
System.Array as parent class for, 245
ArraySegment<T> generic struct, 303–304
as operator, 138
ASP (Active Server Pages)
ASP.NET and, 22, 903
defined, 21
limitations of, 21–22
ASP.NET. See also PCSDemoSite application; Web Forms
ADO.NET and data binding with, 926–939
application configuration, 939–941
ASP and, 22, 903
client-side code, 905–906
code model, 909
code-behind feature, 22
COM objects in, 1171
control palette, 913–914
creating applications using C#, 21–23
creating files in Visual Studio, 906
Crystal Reports Web server controls, 914
custom controls, 944, 952–956
data Web server controls, 917–918
DHTML versus, 22
features, 22
file extensions for code, 909
forms authentication, 964–969
further information, 910
HTML server controls, 910
IIS and, 904
localization using, 544–545
login system implementation, 969–970
login Web server controls, 970–971
master pages, 956–960
navigation Web server controls, 960–963
.NET Remoting servers for, 1050–1051
overview, 904–905
pages as classes, 22
PCSWebApp1 example, 906–908, 909
performance improvements over ASP,22
restricting directory access, 971–973
runat="server" attribute, 905, 910
<script> elements, 905
security, 963–973
server control example, 920–925
similar technologies, 903
standard Web server controls, 914–917
state management in, 905
themes, 974–979
user controls, 944–952
as user interface medium, 25
validation Web server controls, 918–920
viewstate field, 905
WCF and, 1146
Web Forms, 23
Web server controls, 23, 910–925
Web services issues, 1126
WebParts Web server controls, 920
XML Web services, 23
assemblies. See also configuring assemblies
adding resources to, 528–530
as answer to DLL Hell, 412–413
application domains and, 413–416
attributes, 423–425
building, 423–425
calculating permissions required for, 481, 483–484
code access security, 464–478
creating using Visual Studio, 423–425
defined, 17, 411, 412
executable versus library code and, 17
features, 413
global assembly cache, 19, 413, 438–441
ildasm symbols, 420–421
installing, 412
manifests, 418
marking as CLS-compliant, 437
metadata in, 18
modules versus, 421–422
namespaces and, 419
obtaining details of types in, 319–320
overview, 411–416
primary interop assemblies for COM, 1166
private, 18, 412–413, 419
private versus shared, 412–413
probing to find, 451
reflection and, 19
satellite assemblies for languages, 538
shared, 19, 413, 419, 441–449
structure of, 417–418
using CLS for language independence, 427–436
versioning, 412–413, 451–460
viewing assemblies, 420–421
viewing code access permissions for, 473–476
viewing code groups for, 469–471
Visual Basic .NET not case-sensitive, 77
Assembly Cache Viewer, 439–440
Assembly class, 319–320, 452
AssemblyInfo.cs project, 423
asserting permissions, 486–487
assignment operator
assigning values to variables, 34
comparison versus assignment, 48, 134–135
shortcut operators, 135–136
asterisk (*)
as indirection operator for pointers, 207
for multi-line comments (/* and */), 31, 67–68
asynchronous .NET Remoting, 1053–1054
at sign (@) indicating identifiers, 74
ATL Project Wizard (Visual Studio), 1159–1160
atomicity of Enterprise Services transactions, 1078
attributes. See also reflection
of assemblies, 423–425
assembly, defined with Enterprise Services applications, 1071
COM and, 17
COM interop attributes, 1175–1178
of contexts (.NET Remoting), 1015–1016
custom, 306–313
for custom controls (Windows Forms), 787–788
of Enterprise Services transactions, 1079
.NET support for, 17
for user controls (ASP.NET), 947
for user controls (Windows Forms), 798–799
AttributeUsage attribute, 307–309
authentication
in Active Directory binding path, 729
AuthenticateUser() method, 1002
database authentication with ADO.NET, 583, 584
Login() method for obtaining token, 1002–1003, 1005
for shared assemblies, 442
for Web Forms, 964–969
automatic transactions, 1068, 1078
AVG aggregate, 643