You are on page 1of 37

TOOLS, PLATFORM/LANGUAGES USED SELECTED SOFTWARE Microsoft.NET Framewor The .

NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives: To provide a consistent object oriented programming environment whether object code is stored and e!ecuted locally" e!ecuted locally but Internet distributed" or e!ecuted remotely. To provide a code e!ecution environment that minimi#es software

deployment and versioning conflicts. To provide a code e!ecution environment that guarantees safe e!ecution of code" including code created by an unknown or semi trusted third party. To provide a code e!ecution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer e!perience consistent across widely varying types of applications" applications. To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code. The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. %ou can think of the runtime as an agent that manages code at e!ecution time" providing core services such as memory management" thread management" and remoting" while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact" the concept of code management is a fundamental principle of the runtime. &ode that targets the runtime is known as managed code" while code that does not target the runtime is known as unmanaged code. The class library" the other main component of the .NET Framework" is a comprehensive" object oriented collection of reusable types that you can use to develop applications ranging from traditional command line or graphical user interface '()I* applications to applications based on the latest innovations provided by +,-.NET" such as $eb Forms and ./0 $eb services. such as $indows based applications and $eb based

The .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the e!ecution of managed code" thereby creating a software environment that can e!ploit both managed and unmanaged features. The .NET Framework not only provides several runtime hosts" but also supports the development of third party runtime hosts. For e!ample" +,-.NET hosts the runtime to provide a scalable" server side environment for managed code. +,-.NET works directly with the runtime to enable $eb Forms applications and ./0 $eb services" both of which are discussed later in this topic. Internet E!plorer is an e!ample of an unmanaged application that hosts the runtime 'in the form of a /I/E type e!tension*. )sing Internet E!plorer to host the runtime enables you to embed managed components or $indows Forms controls in 1T/0 documents. 1osting the runtime in this way makes managed mobile code 'similar to /icrosoft2 +ctive.2 controls* possible" but with significant improvements that only managed code can offer" such as semi trusted e!ecution and secure isolated file storage. The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system. The illustration also shows how managed code operates within a larger architecture. Feat!res of t"e Commo# La#$!a$e R!#time The common language runtime manages memory" thread e!ecution" code e!ecution" code safety verification" compilation" and other system services. These features are intrinsic to the managed code that runs on the common language runtime. $ith regards to security" managed components are awarded varying degrees of trust" depending on a number of factors that include their origin 'such as the Internet" enterprise network" or local computer*. This means that a managed component might or might not be able to perform file access operations" registry access operations" or other sensitive functions" even if it is being used in the same active application. The runtime enforces code access security. For e!ample" users can trust that an e!ecutable embedded in a $eb page can play an animation on screen or sing a song" but cannot access their personal data" file system" or network. The security features of the runtime thus enable legitimate Internet deployed software to be e!ceptionally feature rich.

The runtime also enforces code robustness by implementing a strict type and code verification infrastructure called the common type system '&T,*. The &T, ensures that all managed code is self describing. The various /icrosoft and third party language compilers generate managed code that conforms to the &T,. This means that managed code can consume other managed types and instances" while strictly enforcing type fidelity and type safety. In addition" the managed environment of the runtime eliminates many common software issues. For e!ample" the runtime automatically handles object layout and manages references to objects" releasing them when they are no longer being used. This automatic memory management resolves the two most common application errors" memory leaks and invalid memory references. The runtime also accelerates developer productivity. For e!ample" programmers can write applications in their development language of choice" yet take full advantage of the runtime" the class library" and components written in other languages by other developers. +ny compiler vendor who chooses to target the runtime can do so. 0anguage compilers that target the .NET Framework make the features of the .NET Framework available to e!isting code written in that language" greatly easing the migration process for e!isting applications. $hile the runtime is designed for the software of the future" it also supports software of today and yesterday. Interoperability between managed and unmanaged code enables developers to continue to use necessary &3/ components and 400s. The runtime is designed to enhance performance. +lthough the common language runtime provides many standard runtime services" managed code is never interpreted. + feature called just in time '5IT* compiling enables all managed code to run in the native machine language of the system on which it is e!ecuting. /eanwhile" the memory manager removes the possibilities of fragmented memory and increases memory locality of reference to further increase performance. Finally" the runtime can be hosted by high performance" server side applications" such as /icrosoft2 ,60 ,erver7 and Internet Information ,ervices 'II,*. This infrastructure enables you to use managed code to write your business logic" while still enjoying the superior performance of the industry8s best enterprise servers that support runtime hosting.

. NET Framewor

C%ass Li&rar'

The .NET Framework class library is a collection of reusable types that tightly integrate with the common language runtime. The class library is object oriented" providing types from which your own managed code can derive functionality. This not only makes the .NET Framework types easy to use" but also reduces the time associated with learning new features of the .NET Framework. In addition" third party components can integrate seamlessly with classes in the .NET Framework. For e!ample" the .NET Framework collection classes implement a set of interfaces that you can use to develop your own collection classes. %our collection classes will blend seamlessly with the classes in the .NET Framework. +s you would e!pect from an object oriented class library" the .NET Framework types enable you to accomplish a range of common programming tasks" including tasks such as string management" data collection" database connectivity" and file access. In addition to these common tasks" the class library includes types that support a variety of speciali#ed development scenarios. For e!ample" you can use the .NET Framework to develop the following types of applications and services: &onsole applications. ,cripted or hosted applications. $indows ()I applications '$indows Forms*. +,-.NET applications. ./0 $eb services. $indows services.

For e!ample" the $indows Forms classes are a comprehensive set of reusable types that vastly simplify $indows ()I development. If you write an +,-.NET $eb Form application" you can use the $eb Forms classes. C%ie#t A((%icatio# De)e%o(me#t &lient applications are the closest to a traditional style of application in $indows based programming. These are the types of applications that display windows or forms on the desktop" enabling a user to perform a task. &lient applications include applications such as word processors and spreadsheets" as well as custom business applications such as data entry tools" reporting tools" and so on. &lient applications usually employ windows" menus" buttons" and other ()I elements" and they likely access local resources such as the file system and peripherals such as printers.

+nother kind of client application is the traditional +ctive. control 'now replaced by the managed $indows Forms control* deployed over the Internet as a $eb page. This application is much like other client applications: it is e!ecuted natively" has access to local resources" and includes graphical elements. In the past" developers created such applications using &9&:: in conjunction with the /icrosoft Foundation &lasses '/F&* or with a rapid application development ';+4* environment such as /icrosoft2 <isual =asic2. The .NET Framework incorporates aspects of these e!isting products into a single" consistent development environment that drastically simplifies the development of client applications. The $indows Forms classes contained in the .NET Framework are designed to be used for ()I development. %ou can easily create command windows" buttons" menus" toolbars" and other screen elements with the fle!ibility necessary to accommodate shifting business needs. For e!ample" the .NET Framework provides simple properties to adjust visual attributes associated with forms. In some cases the underlying operating system does not support changing these attributes directly" and in these cases the .NET Framework automatically recreates the forms. This is one of many ways in which the .NET Framework integrates the developer interface" making coding simpler and more consistent. )nlike +ctive. controls" $indows Forms controls have semi trusted access to a user8s computer. This means that binary or natively e!ecuting code can access some of the resources on the user8s system 'such as ()I elements and limited file access* without being able to access or compromise other resources. =ecause of code access security" many applications that once needed to be installed on a user8s system can now be safely deployed through the $eb. %our applications can implement the features of a local application while being deployed like a $eb page. Ser)er A((%icatio# De)e%o(me#t ,erver side applications in the managed world are implemented through runtime hosts. )nmanaged applications host the common language runtime" which allows your custom managed code to control the behavior of the server. This model provides you with all the features of the common language runtime and class library while gaining the performance and scalability of the host server.

The following illustration shows a basic network schema with managed code running in different server environments. ,ervers such as II, and ,60 ,erver can perform standard operations while your application logic e!ecutes through the managed code. Ser)er*si+e ma#a$e+ co+e +,-.NET is the hosting environment that enables developers to use the .NET Framework to target $eb based applications. 1owever" +,-.NET is more than just a runtime host> it is a complete architecture for developing $eb sites and Internet distributed objects using managed code. =oth $eb Forms and ./0 $eb services use II, and +,-.NET as the publishing mechanism for applications" and both have a collection of supporting classes in the .NET Framework. ./0 $eb services" an important evolution in $eb based technology" are distributed" server side application components similar to common $eb sites. 1owever" unlike $eb based applications" ./0 $eb services components have no )I and are not targeted for browsers such as Internet E!plorer and Netscape Navigator. Instead" ./0 $eb services consist of reusable software components designed to be consumed by other applications" such as traditional client applications" $eb based applications" or even other ./0 $eb services. +s a result" ./0 $eb services technology is rapidly moving application development and deployment into the highly distributed environment of the Internet. If you have used earlier versions of +,- technology" you will immediately notice the improvements that +,-.NET and $eb Forms offers. For e!ample" you can develop $eb Forms pages in any language that supports the .NET Framework. In addition" your code no longer needs to share the same file with your 1TT- te!t 'although it can continue to do so if you prefer*. $eb Forms pages e!ecute in native machine language because" like any other managed application" they take full advantage of the runtime. In contrast" unmanaged +,- pages are always scripted and interpreted. +,-.NET pages are faster" more functional" and easier to develop than unmanaged +,- pages because they interact with the runtime like any managed application. The .NET Framework also provides a collection of classes and tools to aid in development and consumption of ./0 $eb services applications. ./0 $eb services are built on standards such as ,3+- 'a remote procedure call protocol*" ./0 'an e!tensible data format*" and $,40 ' the $eb ,ervices 4escription 0anguage*.

The .NET Framework is built on these standards to promote interoperability with non /icrosoft solutions. For e!ample" the $eb ,ervices 4escription 0anguage tool included with the .NET Framework ,4? can @uery an ./0 $eb service published on the $eb" parse its $,40 description" and produce &A or <isual =asic source code that your application can use to become a client of the ./0 $eb service. The source code can create classes derived from classes in the class library that handle all the underlying communication using ,3+- and ./0 parsing. +lthough you can use the class library to consume ./0 $eb services directly" the $eb ,ervices 4escription 0anguage tool and the other tools contained in the ,4? facilitate your development efforts with the .NET Framework. If you develop and publish your own ./0 $eb service" the .NET Framework provides a set of classes that conform to all the underlying communication standards" such as ,3+-" $,40" and ./0. )sing those classes enables you to focus on the logic of your service" without concerning yourself with the communications infrastructure re@uired by distributed software development. Finally" like $eb Forms pages in the managed environment" your ./0 $eb service will run with the speed of native machine language using the scalable communication of II,. Acti)e Ser)er Pa$es.NET +,-.NET is a programming framework built on the common language runtime that can be used on a server to build powerful $eb applications. +,-.NET offers several important advantages over previous $eb development models: E#"a#ce+ Performa#ce. +,-.NET is compiled common language runtime code running on the server. )nlike its interpreted

predecessors" +,-.NET can take advantage of early binding" just in time compilation" native optimi#ation" and caching services right out of the bo!. This amounts to dramatically better performance before you ever write a line of code. Wor%+*C%ass Too% S!((ort. + rich toolbo! and designer in the <isual ,tudio integrated development environment complement the +,-.NET

framework. $%,I$%( editing" drag and drop server controls" and automatic deployment are just a few of the features this powerful tool provides. Power a#+ F%e,i&i%it'. =ecause +,-.NET is based on the common language runtime" the power and fle!ibility of that entire platform is available to $eb application developers. The .NET Framework class library" /essaging" and 4ata +ccess solutions are all seamlessly accessible from the $eb. +,-.NET is also language independent" so you can choose the language that best applies to your application or partition your application across many languages. Further" common language +,-.NET. Sim(%icit'. +,-.NET makes it easy to perform common tasks" from simple form submission and client authentication to deployment and site configuration. For e!ample" the +,-.NET page framework allows you to build user interfaces that cleanly separate application logic from presentation code and to handle events in a simple" <isual =asic like forms processing model. +dditionally" the common language runtime simplifies development" with managed code services such as automatic reference counting and garbage collection. Ma#a$ea&i%it'. +,-.NET employs a te!t based" hierarchical runtime interoperability guarantees that your e!isting investment in &3/ based development is preserved when migrating to

configuration system" which simplifies applying settings to your server environment and $eb applications. =ecause configuration information is stored as plain te!t" new settings may be applied without the aid of local administration tools. This B#ero local administrationB philosophy e!tends to deploying +,-.NET Framework applications as well. +n +,-.NET Framework application is deployed to a server simply by copying the necessary files to the server. No server restart is re@uired" even to deploy or replace running compiled code. Sca%a&i%it' a#+ A)ai%a&i%it'. +,-.NET has been designed with scalability in mind" with features specifically tailored to improve performance in clustered and multiprocessor environments. Further" processes are closely monitored and managed by the +,-.NET runtime" so that if one misbehaves 'leaks" deadlocks*" a new process

can be created in its place" which helps keep your application constantly available to handle re@uests. C!stomi-a&i%it' a#+ E,te#si&i%it'. +,-.NET delivers a well factored architecture that allows developers to Bplug inB their code at the appropriate level. In fact" it is possible to e!tend or replace any subcomponent of the +,-.NET runtime with your own custom written component. Implementing custom authentication or state services has never been easier. Sec!rit'. $ith built in $indows authentication and per application configuration" you can be assured that your applications are secure. La#$!a$e S!((ort The /icrosoft .NET -latform currently offers built in support for three languages: &A" <isual =asic" and 5,cript.

W"at is ASP.NET We& Forms.


The +,-.NET $eb Forms page framework is a scalable common language runtime programming model that can be used on the server to dynamically generate $eb pages. Intended as a logical evolution of +,- '+,-.NET provides synta! compatibility with e!isting pages*" the +,-.NET $eb Forms framework has been specifically designed to address a number of key deficiencies in the previous model. In particular" it provides: The ability to create and use reusable )I controls that can encapsulate common functionality and thus reduce the amount of code that a page developer has to write. The ability for developers to cleanly structure their page logic in an orderly fashion 'not Bspaghetti codeB*. The ability for development tools to provide strong $%,I$%( design support for pages 'e!isting +,- code is opa@ue to tools*. +,-.NET $eb Forms pages are te!t files with an. asp! file name e!tension. They can be deployed throughout an II, virtual root directory tree. $hen a browser client re@uests. asp! resources" the +,-.NET runtime parses and

compiles the target file into a .NET Framework class. This class can then be used to dynamically process incoming re@uests. 'Note that the .asp! file is compiled only the first time it is accessed> the compiled type instance is then reused across multiple re@uests*. +n +,-.NET page can be created simply by taking an e!isting 1T/0 file and changing its file name e!tension to .asp! 'no modification of code is re@uired*. For e!ample" the following sample demonstrates a simple 1T/0 page that collects a user8s name and category preference and then performs a form postback to the originating page when a button is clicked: +,-.NET provides synta! compatibility with e!isting +,- pages. This includes support for CD DE code render blocks that can be intermi!ed with 1T/0 content within an .asp! file. These code blocks e!ecute in a top down manner at page render time.

Co+e*/e"i#+ We& Forms +,-.NET supports two methods of authoring dynamic pages. The first is the method shown in the preceding samples" where the page code is physically declared within the originating .asp! file. +n alternative approach known as the code behind method enables the page code to be more cleanly separated from the 1T/0 content into an entirely separate file. 0#tro+!ctio# to ASP.NET Ser)er Co#tro%s In addition to 'or instead of* using CD DE code blocks to program dynamic content" +,-.NET page developers can use +,-.NET server controls to program $eb pages. ,erver controls are declared within an .asp! file using custom tags or intrinsic 1T/0 tags that contain a r!#at12ser)er2 attribute value. Intrinsic 1T/0 tags are handled by one of the controls in the S'stem.We&.U0.3tm%Co#tro%s namespace. +ny tag that doesn8t e!plicitly map to one of the controls is assigned the type of S'stem.We&.U0.3tm%Co#tro%s.3tm%Ge#ericCo#tro%. ,erver controls automatically maintain any client entered values between round trips to the server. This control state is not stored on the server 'it is instead stored within an 4i#(!t t'(e12"i++e#25 form field that is round tripped between re@uests*. Note also that no client side script is re@uired.

In addition to supporting standard 1T/0 input controls" +,-.NET enables developers to utili#e richer custom controls on their pages. For e!ample" the following sample demonstrates how the 4as(6a+rotator5 control can be used to dynamically display rotating ads on a page. F. +,-.NET $eb Forms provide an easy and powerful way to build dynamic $eb )I. G. +,-.NET $eb Forms pages can target any browser client 'there are no script library or cookie re@uirements*. H. +,-.NET $eb Forms pages provide synta! compatibility with e!isting +,- pages. I. +,-.NET server controls provide an easy way to encapsulate common functionality. J. +,-.NET ships with IJ built in server controls. 4evelopers can also use controls built by third parties. K. +,-.NET server controls can automatically project both uplevel and downlevel 1T/0. L. +,-.NET templates provide an easy way to customi#e the look and feel of list server controls. M. +,-.NET validation controls provide an easy way to do declarative client or server data validation. Cr'sta% Re(orts &rystal ;eports for <isual =asic .NET is the standard reporting tool for <isual =asic.NET> it brings the ability to create interactive" presentation @uality content N which has been the strength of &rystal ;eports for years N to the .NET platform. $ith &rystal ;eports for <isual =asic.NET" you can host reports on $eb and $indows platforms and publish &rystal reports as ;eport $eb ,ervices on a $eb server. To present data to users" you could write code to loop through recordsets and print them inside your $indows or $eb application. 1owever" any work beyond basic formatting can be complicated: consolidations" multiple level totals" charting" and conditional formatting are difficult to program. $ith &rystal ;eports for <isual ,tudio .NET" you can @uickly create comple! and professional looking reports. Instead of coding" you use the &rystal ;eport 4esigner

interface to create and format the report you need. The powerful ;eport Engine processes the formatting" grouping" and charting criteria you specify. Re(ort E,(erts )sing the &rystal ;eport E!perts" you can @uickly create reports based on your development needs: &hoose from report layout options ranging from standard reports to form letters" or build your own report from scratch. 4isplay charts that users can drill down on to view detailed report data. &alculate summaries" subtotals" and percentages on grouped data. ,how TopN or =ottomN results of data. &onditionally format te!t and rotate te!t objects.

ACT07E 8 DATA O/9ECTS.NET ADO.NET O)er)iew

+43.NET is an evolution of the +43 data access model that directly addresses user re@uirements for developing scalable applications. It was designed specifically for the web with scalability" statelessness" and ./0 in mind. +43.NET uses some +43 objects" such as the Co##ectio# and Comma#+ objects" and also introduces new objects. ?ey new +43.NET objects include the DataSet" DataRea+er" and DataA+a(ter. The important distinction between this evolved stage of +43.NET and previous data architectures is that there e!ists an object the DataSet that is separate and distinct from any data stores. =ecause of that" the DataSet functions as a standalone entity. %ou can think of the 4ata,et as an always disconnected recordset that knows nothing about the source or destination of the data it contains. Inside a DataSet" much like in a database" there are tables" columns" relationships" constraints" views" and so forth. + DataA+a(ter is the object that connects to the database to fill the DataSet. Then" it connects back to the database to update the data there" based on operations performed while the DataSet held the data. In the past" data processing has been primarily connection based. Now" in an effort to make multi tiered apps more

efficient" data processing is turning to a message based approach that revolves around chunks of information. +t the center of this approach is the DataA+a(ter" which provides a bridge to retrieve and save data between a DataSet and its source data store. It accomplishes this by means of re@uests to the appropriate ,60 commands made against the data store. The ./0 based DataSet object provides a consistent programming model that works with all models of data storage: flat" relational" and hierarchical. It does this by having no 8knowledge8 of the source of its data" and by representing the data that it holds as collections and data types. No matter what the source of the data within the DataSet is" it is manipulated through the same set of standard +-Is e!posed through the DataSet and its subordinate objects. $hile the DataSet has no knowledge of the source of its data" the managed provider has detailed and specific information. The role of the managed provider is to connect" fill" and persist the DataSet to and from data stores. The 30E 4= and ,60 ,erver .NET 4ata -roviders ',ystem.4ata.3le4b and ,ystem.4ata.,@l&lient* that are part of the .Net Framework provide four basic objects: the Comma#+" Co##ectio#" DataRea+er and DataA+a(ter. In the remaining sections of this document" we8ll walk through each part of the DataSet and the 30E 4=9,60 ,erver .NET 4ata -roviders e!plaining what they are" and how to program against them. The following sections will introduce you to some objects that have evolved" and some that are new. These objects are: Co##ectio#s. For connection to and managing transactions against a database. Comma#+s. For issuing ,60 commands against a database. DataRea+ers. For reading a forward only stream of data records from a ,60 ,erver data source. DataSets. For storing" remoting and programming against flat data" ./0 data and relational data. DataA+a(ters. For pushing data into a DataSet" and reconciling data against a database. $hen dealing with connections to a database" there are two different options: ,60 ,erver .NET 4ata -rovider ',ystem.4ata.,@l&lient* and 30E 4= .NET 4ata -rovider ',ystem.4ata.3le4b*. In these samples we will use the ,60 ,erver .NET 4ata

-rovider. These are written to talk directly to /icrosoft ,60 ,erver. The 30E 4= .NET 4ata -rovider is used to talk to any 30E 4= provider 'as it uses 30E 4= underneath*.

Co##ectio#s
&onnections are used to 8talk to8 databases" and are respresented by provider specific classes such as S:LCo##ectio#. &ommands travel over connections and resultsets are returned in the form of streams" which can be read by a DataRea+er object" or pushed into a DataSet object. Comma#+s &ommands contain the information that is submitted to a database" and are represented by provider specific classes such as S:LComma#+. + command can be a stored procedure call" an )-4+TE statement" or a statement that returns results. %ou can also use input and output parameters" and return values as part of your command synta!. The e!ample below shows how to issue an IN,E;T statement against the Nort"wi#+ database. DataRea+ers The DataRea+er object is somewhat synonymous with a read only9forward only cursor over data. The DataRea+er +-I supports flat as well as hierarchical data. + DataRea+er object is returned after e!ecuting a command against a database. The format of the returned DataRea+er object is different from a recordset. For e!ample" you might use the DataRea+er to show the results of a search list in a web page. DataSets a#+ DataA+a(ters

DataSets The DataSet object is similar to the ADO Recordset object, but more powerful, and with one other important distinction: the DataSet is always disconnected. The DataSet object represents a cache of data, with database-like structures such as tables, columns, relationships, and constraints. Howe er, thou!h a DataSet can and does beha e much like a database, it is important to remember that DataSet objects do not interact directly with databases, or other source data. This allows the de eloper to work with a pro!rammin! model that is always consistent, re!ardless of where the source data resides. Data comin! from a database, an "#$ file, from code, or user input can all be placed into DataSet objects. Then, as chan!es are made to the DataSet they can be tracked and

erified before updatin! the source data. The GetChanges method of the DataSet object actually creates a second DatSet that contains only the chan!es to the data. This DataSet is then used by a DataAdapter %or other objects& to update the ori!inal data source.
SELECTED SOFTWARE Microsoft.NET Framewor The .NET Framework is a new computing platform that simplifies application development in the highly distributed environment of the Internet. The .NET Framework is designed to fulfill the following objectives: To provide a consistent object oriented programming environment whether object code is stored and e!ecuted locally" e!ecuted locally but Internet distributed" or e!ecuted remotely. To provide a code e!ecution environment that minimi#es software

deployment and versioning conflicts. To provide a code e!ecution environment that guarantees safe e!ecution of code" including code created by an unknown or semi trusted third party. To provide a code e!ecution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer e!perience consistent across widely varying types of applications" applications. To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code. The .NET Framework has two main components: the common language runtime and the .NET Framework class library. The common language runtime is the foundation of the .NET Framework. %ou can think of the runtime as an agent that manages code at e!ecution time" providing core services such as memory management" thread management" and remoting" while also enforcing strict type safety and other forms of code accuracy that ensure security and robustness. In fact" the concept of code management is a fundamental principle of the runtime. &ode that targets the runtime is known as managed code" while code that does not target the runtime is known as unmanaged code. The class library" the other main component of the .NET Framework" is a comprehensive" object oriented collection of reusable types that you can use to develop applications ranging from traditional command line or graphical such as $indows based applications and $eb based

user interface '()I* applications to applications based on the latest innovations provided by +,-.NET" such as $eb Forms and ./0 $eb services. The .NET Framework can be hosted by unmanaged components that load the common language runtime into their processes and initiate the e!ecution of managed code" thereby creating a software environment that can e!ploit both managed and unmanaged features. The .NET Framework not only provides several runtime hosts" but also supports the development of third party runtime hosts. For e!ample" +,-.NET hosts the runtime to provide a scalable" server side environment for managed code. +,-.NET works directly with the runtime to enable $eb Forms applications and ./0 $eb services" both of which are discussed later in this topic. Internet E!plorer is an e!ample of an unmanaged application that hosts the runtime 'in the form of a /I/E type e!tension*. )sing Internet E!plorer to host the runtime enables you to embed managed components or $indows Forms controls in 1T/0 documents. 1osting the runtime in this way makes managed mobile code 'similar to /icrosoft2 +ctive.2 controls* possible" but with significant improvements that only managed code can offer" such as semi trusted e!ecution and secure isolated file storage. The following illustration shows the relationship of the common language runtime and the class library to your applications and to the overall system. The illustration also shows how managed code operates within a larger architecture. Feat!res of t"e Commo# La#$!a$e R!#time The common language runtime manages memory" thread e!ecution" code e!ecution" code safety verification" compilation" and other system services. These features are intrinsic to the managed code that runs on the common language runtime. $ith regards to security" managed components are awarded varying degrees of trust" depending on a number of factors that include their origin 'such as the Internet" enterprise network" or local computer*. This means that a managed component might or might not be able to perform file access operations" registry access operations" or other sensitive functions" even if it is being used in the same active application. The runtime enforces code access security. For e!ample" users can trust that an e!ecutable embedded in a $eb page can play an animation on screen or sing a song"

but cannot access their personal data" file system" or network. The security features of the runtime thus enable legitimate Internet deployed software to be e!ceptionally feature rich. The runtime also enforces code robustness by implementing a strict type and code verification infrastructure called the common type system '&T,*. The &T, ensures that all managed code is self describing. The various /icrosoft and third party language compilers generate managed code that conforms to the &T,. This means that managed code can consume other managed types and instances" while strictly enforcing type fidelity and type safety. In addition" the managed environment of the runtime eliminates many common software issues. For e!ample" the runtime automatically handles object layout and manages references to objects" releasing them when they are no longer being used. This automatic memory management resolves the two most common application errors" memory leaks and invalid memory references. The runtime also accelerates developer productivity. For e!ample" programmers can write applications in their development language of choice" yet take full advantage of the runtime" the class library" and components written in other languages by other developers. +ny compiler vendor who chooses to target the runtime can do so. 0anguage compilers that target the .NET Framework make the features of the .NET Framework available to e!isting code written in that language" greatly easing the migration process for e!isting applications. $hile the runtime is designed for the software of the future" it also supports software of today and yesterday. Interoperability between managed and unmanaged code enables developers to continue to use necessary &3/ components and 400s. The runtime is designed to enhance performance. +lthough the common language runtime provides many standard runtime services" managed code is never interpreted. + feature called just in time '5IT* compiling enables all managed code to run in the native machine language of the system on which it is e!ecuting. /eanwhile" the memory manager removes the possibilities of fragmented memory and increases memory locality of reference to further increase performance. Finally" the runtime can be hosted by high performance" server side applications" such as /icrosoft2 ,60 ,erver7 and Internet Information ,ervices 'II,*. This infrastructure enables you to use managed code to write your business logic" while

still enjoying the superior performance of the industry8s best enterprise servers that support runtime hosting. . NET Framewor C%ass Li&rar'

The .NET Framework class library is a collection of reusable types that tightly integrate with the common language runtime. The class library is object oriented" providing types from which your own managed code can derive functionality. This not only makes the .NET Framework types easy to use" but also reduces the time associated with learning new features of the .NET Framework. In addition" third party components can integrate seamlessly with classes in the .NET Framework. For e!ample" the .NET Framework collection classes implement a set of interfaces that you can use to develop your own collection classes. %our collection classes will blend seamlessly with the classes in the .NET Framework. +s you would e!pect from an object oriented class library" the .NET Framework types enable you to accomplish a range of common programming tasks" including tasks such as string management" data collection" database connectivity" and file access. In addition to these common tasks" the class library includes types that support a variety of speciali#ed development scenarios. For e!ample" you can use the .NET Framework to develop the following types of applications and services: &onsole applications. ,cripted or hosted applications. $indows ()I applications '$indows Forms*. +,-.NET applications. ./0 $eb services. $indows services.

For e!ample" the $indows Forms classes are a comprehensive set of reusable types that vastly simplify $indows ()I development. If you write an +,-.NET $eb Form application" you can use the $eb Forms classes. C%ie#t A((%icatio# De)e%o(me#t &lient applications are the closest to a traditional style of application in $indows based programming. These are the types of applications that display windows or forms on the desktop" enabling a user to perform a task. &lient applications include applications such as word processors and spreadsheets" as well as custom business

applications such as data entry tools" reporting tools" and so on. &lient applications usually employ windows" menus" buttons" and other ()I elements" and they likely access local resources such as the file system and peripherals such as printers. +nother kind of client application is the traditional +ctive. control 'now replaced by the managed $indows Forms control* deployed over the Internet as a $eb page. This application is much like other client applications: it is e!ecuted natively" has access to local resources" and includes graphical elements. In the past" developers created such applications using &9&:: in conjunction with the /icrosoft Foundation &lasses '/F&* or with a rapid application development ';+4* environment such as /icrosoft2 <isual =asic2. The .NET Framework incorporates aspects of these e!isting products into a single" consistent development environment that drastically simplifies the development of client applications. The $indows Forms classes contained in the .NET Framework are designed to be used for ()I development. %ou can easily create command windows" buttons" menus" toolbars" and other screen elements with the fle!ibility necessary to accommodate shifting business needs. For e!ample" the .NET Framework provides simple properties to adjust visual attributes associated with forms. In some cases the underlying operating system does not support changing these attributes directly" and in these cases the .NET Framework automatically recreates the forms. This is one of many ways in which the .NET Framework integrates the developer interface" making coding simpler and more consistent. )nlike +ctive. controls" $indows Forms controls have semi trusted access to a user8s computer. This means that binary or natively e!ecuting code can access some of the resources on the user8s system 'such as ()I elements and limited file access* without being able to access or compromise other resources. =ecause of code access security" many applications that once needed to be installed on a user8s system can now be safely deployed through the $eb. %our applications can implement the features of a local application while being deployed like a $eb page. Ser)er A((%icatio# De)e%o(me#t ,erver side applications in the managed world are implemented through runtime hosts. )nmanaged applications host the common language runtime" which allows your custom managed code to control the behavior of the server. This model

provides you with all the features of the common language runtime and class library while gaining the performance and scalability of the host server. The following illustration shows a basic network schema with managed code running in different server environments. ,ervers such as II, and ,60 ,erver can perform standard operations while your application logic e!ecutes through the managed code. Ser)er*si+e ma#a$e+ co+e +,-.NET is the hosting environment that enables developers to use the .NET Framework to target $eb based applications. 1owever" +,-.NET is more than just a runtime host> it is a complete architecture for developing $eb sites and Internet distributed objects using managed code. =oth $eb Forms and ./0 $eb services use II, and +,-.NET as the publishing mechanism for applications" and both have a collection of supporting classes in the .NET Framework. ./0 $eb services" an important evolution in $eb based technology" are distributed" server side application components similar to common $eb sites. 1owever" unlike $eb based applications" ./0 $eb services components have no )I and are not targeted for browsers such as Internet E!plorer and Netscape Navigator. Instead" ./0 $eb services consist of reusable software components designed to be consumed by other applications" such as traditional client applications" $eb based applications" or even other ./0 $eb services. +s a result" ./0 $eb services technology is rapidly moving application development and deployment into the highly distributed environment of the Internet. If you have used earlier versions of +,- technology" you will immediately notice the improvements that +,-.NET and $eb Forms offers. For e!ample" you can develop $eb Forms pages in any language that supports the .NET Framework. In addition" your code no longer needs to share the same file with your 1TT- te!t 'although it can continue to do so if you prefer*. $eb Forms pages e!ecute in native machine language because" like any other managed application" they take full advantage of the runtime. In contrast" unmanaged +,- pages are always scripted and interpreted. +,-.NET pages are faster" more functional" and easier to develop than unmanaged +,- pages because they interact with the runtime like any managed application. The .NET Framework also provides a collection of classes and tools to aid in development and consumption of ./0 $eb services applications. ./0 $eb services are built on standards such as ,3+- 'a remote procedure call protocol*" ./0 'an

e!tensible data format*" and $,40 ' the $eb ,ervices 4escription 0anguage*. The .NET Framework is built on these standards to promote interoperability with non /icrosoft solutions. For e!ample" the $eb ,ervices 4escription 0anguage tool included with the .NET Framework ,4? can @uery an ./0 $eb service published on the $eb" parse its $,40 description" and produce &A or <isual =asic source code that your application can use to become a client of the ./0 $eb service. The source code can create classes derived from classes in the class library that handle all the underlying communication using ,3+- and ./0 parsing. +lthough you can use the class library to consume ./0 $eb services directly" the $eb ,ervices 4escription 0anguage tool and the other tools contained in the ,4? facilitate your development efforts with the .NET Framework. If you develop and publish your own ./0 $eb service" the .NET Framework provides a set of classes that conform to all the underlying communication standards" such as ,3+-" $,40" and ./0. )sing those classes enables you to focus on the logic of your service" without concerning yourself with the communications infrastructure re@uired by distributed software development.

'inally, like (eb 'orms pa!es in the mana!ed en ironment, your "#$ (eb ser ice will run with the speed of nati e machine lan!ua!e usin! the scalable communication of ))*.

Acti)e Ser)er Pa$es.NET +,-.NET is a programming framework built on the common language runtime that can be used on a server to build powerful $eb applications. +,-.NET offers several important advantages over previous $eb development models: E#"a#ce+ Performa#ce. +,-.NET is compiled common language runtime code running on the server. )nlike its interpreted

predecessors" +,-.NET can take advantage of early binding" just in time compilation" native optimi#ation" and caching services right out of the bo!. This amounts to dramatically better performance before you ever write a line of code.

Wor%+*C%ass Too% S!((ort. + rich toolbo! and designer in the <isual ,tudio integrated development environment complement the +,-.NET framework. $%,I$%( editing" drag and drop server controls" and automatic deployment are just a few of the features this powerful tool provides.

Power a#+ F%e,i&i%it'. =ecause +,-.NET is based on the common language runtime" the power and fle!ibility of that entire platform is available to $eb application developers. The .NET Framework class library" /essaging" and 4ata +ccess solutions are all seamlessly accessible from the $eb. +,-.NET is also language independent" so you can choose the language that best applies to your application or partition your application across many languages. Further" common language +,-.NET. runtime interoperability guarantees that your e!isting investment in &3/ based development is preserved when migrating to

Sim(%icit'. +,-.NET makes it easy to perform common tasks" from simple form submission and client authentication to deployment and site configuration. For e!ample" the +,-.NET page framework allows you to build user interfaces that cleanly separate application logic from presentation code and to handle events in a simple" <isual =asic like forms processing model. +dditionally" the common language runtime simplifies development" with managed code services such as automatic reference counting and garbage collection.

Ma#a$ea&i%it'.

+,-.NET

employs

te!t based"

hierarchical

configuration system" which simplifies applying settings to your server environment and $eb applications. =ecause configuration information is stored as plain te!t" new settings may be applied without the aid of local administration tools. This B#ero local administrationB philosophy e!tends to deploying +,-.NET Framework applications as well. +n +,-.NET Framework application is deployed to a server simply by copying the necessary files to the server. No server restart is re@uired" even to deploy or replace running compiled code. Sca%a&i%it' a#+ A)ai%a&i%it'. +,-.NET has been designed with scalability in mind" with features specifically tailored to improve performance in clustered and multiprocessor environments. Further"

processes are closely monitored and managed by the +,-.NET runtime" so that if one misbehaves 'leaks" deadlocks*" a new process can be created in its place" which helps keep your application constantly available to handle re@uests. C!stomi-a&i%it' a#+ E,te#si&i%it'. +,-.NET delivers a well factored architecture that allows developers to Bplug inB their code at the appropriate level. In fact" it is possible to e!tend or replace any subcomponent of the +,-.NET runtime with your own custom written component. Implementing custom authentication or state services has never been easier. Sec!rit'. $ith built in $indows authentication and per application configuration" you can be assured that your applications are secure. La#$!a$e S!((ort The /icrosoft .NET -latform currently offers built in support for three languages: &A" <isual =asic" and 5,cript.

W"at is ASP.NET We& Forms.


The +,-.NET $eb Forms page framework is a scalable common language runtime programming model that can be used on the server to dynamically generate $eb pages. Intended as a logical evolution of +,- '+,-.NET provides synta! compatibility with e!isting pages*" the +,-.NET $eb Forms framework has been specifically designed to address a number of key deficiencies in the previous model. In particular" it provides: The ability to create and use reusable )I controls that can encapsulate common functionality and thus reduce the amount of code that a page developer has to write. The ability for developers to cleanly structure their page logic in an orderly fashion 'not Bspaghetti codeB*. The ability for development tools to provide strong $%,I$%( design support for pages 'e!isting +,- code is opa@ue to tools*.

+,-.NET $eb Forms pages are te!t files with an. asp! file name e!tension. They can be deployed throughout an II, virtual root directory tree. $hen a browser client re@uests. asp! resources" the +,-.NET runtime parses and compiles the target file into a .NET Framework class. This class can then be used to dynamically process incoming re@uests. 'Note that the .asp! file is compiled only the first time it is accessed> the compiled type instance is then reused across multiple re@uests*. +n +,-.NET page can be created simply by taking an e!isting 1T/0 file and changing its file name e!tension to .asp! 'no modification of code is re@uired*. For e!ample" the following sample demonstrates a simple 1T/0 page that collects a user8s name and category preference and then performs a form postback to the originating page when a button is clicked: +,-.NET provides synta! compatibility with e!isting +,- pages. This includes support for CD DE code render blocks that can be intermi!ed with 1T/0 content within an .asp! file. These code blocks e!ecute in a top down manner at page render time. Co+e*/e"i#+ We& Forms +,-.NET supports two methods of authoring dynamic pages. The first is the method shown in the preceding samples" where the page code is physically declared within the originating .asp! file. +n alternative approach known as the code behind method enables the page code to be more cleanly separated from the 1T/0 content into an entirely separate file. 0#tro+!ctio# to ASP.NET Ser)er Co#tro%s In addition to 'or instead of* using CD DE code blocks to program dynamic content" +,-.NET page developers can use +,-.NET server controls to program $eb pages. ,erver controls are declared within an .asp! file using custom tags or intrinsic 1T/0 tags that contain a r!#at12ser)er2 attribute value. Intrinsic 1T/0 tags are handled by one of the controls in the S'stem.We&.U0.3tm%Co#tro%s namespace. +ny tag that doesn8t e!plicitly map to one of the controls is assigned the type of S'stem.We&.U0.3tm%Co#tro%s.3tm%Ge#ericCo#tro%. ,erver controls automatically maintain any client entered values between round trips to the server. This control state is not stored on the server 'it is

instead stored within an 4i#(!t t'(e12"i++e#25 form field that is round tripped between re@uests*. Note also that no client side script is re@uired. In addition to supporting standard 1T/0 input controls" +,-.NET enables developers to utili#e richer custom controls on their pages. For e!ample" the following sample demonstrates how the 4as(6a+rotator5 control can be used to dynamically display rotating ads on a page. O. +,-.NET $eb Forms provide an easy and powerful way to build dynamic $eb )I. FP. +,-.NET $eb Forms pages can target any browser client 'there are no script library or cookie re@uirements*. FF. +,-.NET $eb Forms pages provide synta! compatibility with e!isting +,- pages. FG. +,-.NET server controls provide an easy way to encapsulate common functionality. FH. +,-.NET ships with IJ built in server controls. 4evelopers can also use controls built by third parties. FI. +,-.NET server controls can automatically project both uplevel and downlevel 1T/0. FJ. +,-.NET templates provide an easy way to customi#e the look and feel of list server controls. FK. +,-.NET validation controls provide an easy way to do declarative client or server data validation.

Cr'sta% Re(orts &rystal ;eports for <isual =asic .NET is the standard reporting tool for <isual =asic.NET> it brings the ability to create interactive" presentation @uality content N which has been the strength of &rystal ;eports for years N to the .NET platform. $ith &rystal ;eports for <isual =asic.NET" you can host reports on $eb and $indows platforms and publish &rystal reports as ;eport $eb ,ervices on a $eb server.

To present data to users" you could write code to loop through recordsets and print them inside your $indows or $eb application. 1owever" any work beyond basic formatting can be complicated: consolidations" multiple level totals" charting" and conditional formatting are difficult to program. $ith &rystal ;eports for <isual ,tudio .NET" you can @uickly create comple! and professional looking reports. Instead of coding" you use the &rystal ;eport 4esigner interface to create and format the report you need. The powerful ;eport Engine processes the formatting" grouping" and charting criteria you specify. Re(ort E,(erts )sing the &rystal ;eport E!perts" you can @uickly create reports based on your development needs: &hoose from report layout options ranging from standard reports to form letters" or build your own report from scratch. 4isplay charts that users can drill down on to view detailed report data. &alculate summaries" subtotals" and percentages on grouped data. ,how TopN or =ottomN results of data. &onditionally format te!t and rotate te!t objects.

ACT07E 8 DATA O/9ECTS.NET ADO.NET O)er)iew

+43.NET is an evolution of the +43 data access model that directly addresses user re@uirements for developing scalable applications. It was designed specifically for the web with scalability" statelessness" and ./0 in mind. +43.NET uses some +43 objects" such as the Co##ectio# and Comma#+ objects" and also introduces new objects. ?ey new +43.NET objects include the DataSet" DataRea+er" and DataA+a(ter. The important distinction between this evolved stage of +43.NET and previous data architectures is that there e!ists an object the DataSet that is separate and distinct from any data stores. =ecause of that" the DataSet functions as a standalone entity. %ou can think of the 4ata,et as an always disconnected recordset that knows nothing about the source or destination of the data it contains. Inside a

DataSet" much like in a database" there are tables" columns" relationships" constraints" views" and so forth. + DataA+a(ter is the object that connects to the database to fill the DataSet. Then" it connects back to the database to update the data there" based on operations performed while the DataSet held the data. In the past" data processing has been primarily connection based. Now" in an effort to make multi tiered apps more efficient" data processing is turning to a message based approach that revolves around chunks of information. +t the center of this approach is the DataA+a(ter" which provides a bridge to retrieve and save data between a DataSet and its source data store. It accomplishes this by means of re@uests to the appropriate ,60 commands made against the data store. The ./0 based DataSet object provides a consistent programming model that works with all models of data storage: flat" relational" and hierarchical. It does this by having no 8knowledge8 of the source of its data" and by representing the data that it holds as collections and data types. No matter what the source of the data within the DataSet is" it is manipulated through the same set of standard +-Is e!posed through the DataSet and its subordinate objects. $hile the DataSet has no knowledge of the source of its data" the managed provider has detailed and specific information. The role of the managed provider is to connect" fill" and persist the DataSet to and from data stores. The 30E 4= and ,60 ,erver .NET 4ata -roviders ',ystem.4ata.3le4b and ,ystem.4ata.,@l&lient* that are part of the .Net Framework provide four basic objects: the Comma#+" Co##ectio#" DataRea+er and DataA+a(ter. In the remaining sections of this document" we8ll walk through each part of the DataSet and the 30E 4=9,60 ,erver .NET 4ata -roviders e!plaining what they are" and how to program against them. The following sections will introduce you to some objects that have evolved" and some that are new. These objects are: Co##ectio#s. For connection to and managing transactions against a database. Comma#+s. For issuing ,60 commands against a database. DataRea+ers. For reading a forward only stream of data records from a ,60 ,erver data source. DataSets. For storing" remoting and programming against flat data" ./0 data and relational data.

DataA+a(ters. For pushing data into a DataSet" and reconciling data against a database.

$hen dealing with connections to a database" there are two different options: ,60 ,erver .NET 4ata -rovider ',ystem.4ata.,@l&lient* and 30E 4= .NET 4ata -rovider ',ystem.4ata.3le4b*. In these samples we will use the ,60 ,erver .NET 4ata -rovider. These are written to talk directly to /icrosoft ,60 ,erver. The 30E 4= .NET 4ata -rovider is used to talk to any 30E 4= provider 'as it uses 30E 4= underneath*.

Co##ectio#s
&onnections are used to 8talk to8 databases" and are respresented by provider specific classes such as S:LCo##ectio#. &ommands travel over connections and resultsets are returned in the form of streams" which can be read by a DataRea+er object" or pushed into a DataSet object. Comma#+s &ommands contain the information that is submitted to a database" and are represented by provider specific classes such as S:LComma#+. + command can be a stored procedure call" an )-4+TE statement" or a statement that returns results. %ou can also use input and output parameters" and return values as part of your command synta!. The e!ample below shows how to issue an IN,E;T statement against the Nort"wi#+ database. DataRea+ers The DataRea+er object is somewhat synonymous with a read only9forward only cursor over data. The DataRea+er +-I supports flat as well as hierarchical data. + DataRea+er object is returned after e!ecuting a command against a database. The format of the returned DataRea+er object is different from a recordset. For e!ample" you might use the DataRea+er to show the results of a search list in a web page. DataSets a#+ DataA+a(ters DataSets The DataSet object is similar to the +43 Recor+set object" but more powerful" and with one other important distinction: the DataSet is always disconnected. The DataSet object represents a cache of data" with database like structures such as tables" columns" relationships" and constraints. 1owever" though a DataSet can and

does behave much like a database" it is important to remember that DataSet objects do not interact directly with databases" or other source data. This allows the developer to work with a programming model that is always consistent" regardless of where the source data resides. 4ata coming from a database" an ./0 file" from code" or user input can all be placed into DataSet objects. Then" as changes are made to the DataSet they can be tracked and verified before updating the source data. The GetC"a#$es method of the DataSet object actually creates a second DatSet that contains only the changes to the data. This DataSet is then used by a DataA+a(ter 'or other objects* to update the original data source. The DataSet has many ./0 characteristics" including the ability to produce and consume ./0 data and ./0 schemas. ./0 schemas can be used to describe schemas interchanged via $eb,ervices. In fact" a DataSet with a schema can actually be compiled for type safety and statement completion. DataA+a(ters ;OLED//S:L< The DataA+a(ter object works as a bridge between the DataSet and the source data. )sing the provider specific S=%DataA+a(ter 'along with its associated S=%Comma#+ and S=%Co##ectio#* can increase overall performance when working with a /icrosoft ,60 ,erver databases. For other 30E 4= supported databases" you would use the O%eD&DataA+a(ter object and its associated O%eD&Comma#+ and O%eD&Co##ectio# objects. The DataA+a(ter object uses commands to update the data source after changes have been made to the DataSet. )sing the Fi%% method of the DataA+a(ter calls the ,E0E&T command> using the U(+ate method calls the IN,E;T" )-4+TE or 4E0ETE command for each changed row. %ou can e!plicitly set these commands in order to control the statements used at runtime to resolve changes" including the use of stored procedures. For ad hoc scenarios" a Comma#+/!i%+er object can generate these at run time based upon a select statement. 1owever" this run time generation re@uires an e!tra round trip to the server in order to gather re@uired metadata" so e!plicitly providing the IN,E;T" )-4+TE" and 4E0ETE commands at design time will result in better run time performance. F. +43.NET is the ne!t evolution of +43 for the .Net Framework. G. +43.NET was created with n Tier" statelessness and ./0 in the forefront. Two new objects" the DataSet and DataA+a(ter" are provided for these scenarios.

H. +43.NET can be used to get data from a stream" or to store data in a cache for updates. I. There is a lot more information about +43.NET in the documentation. J. ;emember" you can e!ecute a command directly against the database in order to do inserts" updates" and deletes. %ou don8t need to first put data into a DataSet in order to insert" update" or delete it. K. +lso" you can use a DataSet to bind to the data" move through the data" and navigate data relationships >.? S:L SER7ER @AAA /icrosoft2 ,60 ,erver7 GPPP is a set of components that work together to meet the data storage and analysis needs of the largest $eb sites and enterprise data processing systems. The topics in ,60 ,erver +rchitecture describe how the various components work together to manage data effectively. @.>.B. Feat!res of S:L Ser)er @AAA /icrosoft2 ,60 ,erver7 GPPP features include: Internet Integration. The ,60 ,erver GPPP database engine includes integrated ./0 support. It also has the scalability" availability" and security features re@uired to operate as the data storage component of the largest $eb sites. The ,60 ,erver GPPP programming model is integrated with the $indows 4N+ architecture for developing $eb applications" and ,60 ,erver GPPP supports features such as English 6uery and the /icrosoft ,earch ,ervice to incorporate user friendly @ueries and powerful search capabilities in $eb applications. ,calability and +vailability. The same database engine can be used across platforms ranging from laptop computers running /icrosoft $indows2 OM through large" multiprocessor servers running /icrosoft $indows GPPP 4ata &enter Edition. ,60 ,erver GPPP Enterprise Edition supports features such as federated servers" inde!ed views" and large memory support that allow it to scale to the performance levels re@uired by the largest $eb sites. Enterprise 0evel 4atabase Features. The ,60 ,erver GPPP relational database engine supports the features re@uired to support demanding data processing environments. The database engine protects data integrity while minimi#ing the overhead of managing thousands of users concurrently modifying the database. ,60 ,erver GPPP distributed @ueries allow you to reference data from multiple sources as if it were a part of a ,60 ,erver GPPP database" while at the same time" the distributed transaction support protects the integrity of any updates of the distributed data. ;eplication allows you to also maintain multiple copies of

data" while ensuring that the separate copies remain synchroni#ed. %ou can replicate a set of data to multiple" mobile" disconnected users" have them work autonomously" and then merge their modifications back to the publisher. Ease of installation" deployment" and use. ,60 ,erver GPPP includes a set of administrative and development tools that improve upon the process of installing" deploying" managing" and using ,60 ,erver across several sites. ,60 ,erver GPPP also supports a standards based programming model integrated with the $indows 4N+" making the use of ,60 ,erver databases and data warehouses a seamless part of building powerful and scalable systems. These features allow you to rapidly deliver ,60 ,erver applications that customers can implement with a minimum of installation and administrative overhead. 4ata warehousing. ,60 ,erver GPPP includes tools for e!tracting and analy#ing summary data for online analytical processing. ,60 ,erver also includes tools for visually designing databases and analy#ing data using English based @uestions. @.>.@ Re%atio#a% Data&ase Com(o#e#ts The database component of /icrosoft2 ,60 ,erver7 GPPP is a ,tructured 6uery 0anguage ',60*Qbased" scalable" relational database with integrated E!tensible /arkup 0anguage './0* support for Internet applications. Each of the following terms describes a fundamental part of the architecture of the ,60 ,erver GPPP database component: Data&ase + database is similar to a data file in that it is a storage place for data. 0ike a data file" a database does not present information directly to a user> the user runs an application that accesses data from the database and presents it to the user in an understandable format. 4atabase systems are more powerful than data files in that data is more highly organi#ed. In a well designed database" there are no duplicate pieces of data that the user or application must update at the same time. ;elated pieces of data are grouped together in a single structure or record" and relationships can be defined between these structures and records. $hen working with data files" an application must be coded to work with the specific structure of each data file. In contrast" a database contains a catalog that applications use to determine how data is organi#ed. (eneric database applications can use the catalog to present users with data from different databases dynamically" without being tied to a specific data format. + database typically has two main parts: first" the files holding the physical database and second" the database management system '4=/,* software

that applications use to access data. The 4=/, is responsible for enforcing the database structure" including: /aintaining relationships between data in the database. Ensuring that data is stored correctly" and that the rules defining data relationships are not violated. ;ecovering all data to a point of known consistency in case of system failures. @.>.? Re%atio#a% Data&ase +lthough there are different ways to organi#e data in a database" relational databases are one of the most effective. ;elational database systems are an application of mathematical set theory to the problem of effectively organi#ing data. In a relational database" data is collected into tables 'called relations in relational theory*. + table represents some class of objects that are important to an organi#ation. For e!ample" a company may have a database with a table for employees" another table for customers" and another for stores. Each table is built of columns and rows 'called attributes and topples in relational theory*. Each column represents some attribute of the object represented by the table. For e!ample" an Em(%o'ee table would typically have columns for attributes such as first name" last name" employee I4" department" pay grade" and job title. Each row represents an instance of the object represented by the table. For e!ample" one row in the Em(%o'ee table represents the employee who has employee I4 FGHIJ. $hen organi#ing data into tables" you can usually find many different ways to define tables. ;elational database theory defines a process called normali#ation" which ensures that the set of tables you define will organi#e your data effectively. Sca%a&%e ,60 ,erver GPPP supports having a wide range of users access it at the same time. +n instance of ,60 ,erver GPPP includes the files that make up a set of databases and a copy of the 4=/, software. +pplications running on separate computers use a ,60 ,erver GPPP communications component to transmit commands over a network to the ,60 ,erver GPPP instance. $hen an application connects to an instance of ,60 ,erver GPPP" it can reference any of the databases in that instance that the user is authori#ed to access. The communication component also allows communication between an instance of ,60 ,erver GPPP and an application running on the same computer. %ou can run multiple instances of ,60 ,erver GPPP on a single computer. ,60 ,erver GPPP is designed to support the traffic of the largest $eb sites or enterprise data processing systems. Instances of ,60 ,erver GPPP running on large" multiprocessor servers are capable of supporting connections to thousands of users at the same time. The data in ,60 ,erver tables can be partitioned across multiple servers" so that several multiprocessor computers

can cooperate to support the database processing re@uirements of e!tremely large systems. These groups of database servers are called federations. +lthough ,60 ,erver GPPP is designed to work as the data storage engine for thousands of concurrent users who connect over a network" it is also capable of working as a stand alone database directly on the same computer as an application. The scalability and ease of use features of ,60 ,erver GPPP allow it to work efficiently on a single computer without consuming too many resources or re@uiring administrative work by the stand alone user. The same features allow ,60 ,erver GPPP to dynamically ac@uire the resources re@uired to support thousands of users" while minimi#ing database administration and tuning. The ,60 ,erver GPPP relational database engine dynamically tunes itself to ac@uire or free the appropriate computer resources re@uired to support a varying load of users accessing an instance of ,60 ,erver GPPP at any specific time. The ,60 ,erver GPPP relational database engine has features to prevent the logical problems that occur if a user tries to read or modify data currently used by others. Str!ct!re+ :!er' La#$!a$e To work with data in a database" you have to use a set of commands and statements 'language* defined by the 4=/, software. ,everal different languages can be used with relational databases> the most common is ,60. The +merican National ,tandards Institute '+N,I* and the International ,tandards 3rgani#ation 'I,3* define software standards" including standards for the ,60 language. ,60 ,erver GPPP supports the Entry 0evel of ,60 OG" the ,60 standard published by +N,I and I,3 in FOOG. The dialect of ,60 supported by /icrosoft ,60 ,erver is called Transact ,60 'T ,60*. T ,60 is the primary language used by /icrosoft ,60 ,erver applications. E,te#si&%e Mar !( La#$!a$e ./0 is the emerging Internet standard for data. ./0 is a set of tags that can be used to define the structure of a hyperte!t document. The 1yperte!t /arkup 0anguage can easily process ./0 documents" which is the most important language for displaying $eb pages. +lthough most ,60 statements return their results in a relational" or tabular" result set" the ,60 ,erver GPPP database component supports a F3; ./0 clause that returns results as an ./0 document. ,60 ,erver GPPP also supports .-ath @ueries from Internet and intranet applications. ./0 documents can be added to ,60 ,erver databases" and the 3-EN./0 clause can be used to e!pose data from an ./0 document as a relational result set. @.>.> Data&ase Arc"itect!re /icrosoft2 ,60 ,erver7 GPPP data is stored in databases. The data in a database is organi#ed into the logical components visible to users. + database is also physically implemented as two or more files on disk. $hen using a database" you work primarily with the logical components such as tables" views" procedures" and users. The physical implementation of files

is largely transparent. Typically" only the database administrator needs to work with the physical implementation. Each instance of ,60 ,erver has four system databases ' master" mo+e%" tem(+&" and ms+&* and one or more user databases. ,ome organi#ations have only one user database" containing all the data for their organi#ation. ,ome organi#ations have different databases for each group in their organi#ation" and sometimes a database used by a single application. For e!ample" an organi#ation could have one database for sales" one for payroll" one for a document management application" and so on. ,ometimes an application uses only one database> other applications may access several databases. It is not necessary to run multiple copies of the ,60 ,erver database engine to allow multiple users to access the databases on a server. +n instance of the ,60 ,erver ,tandard or Enterprise Edition is capable of handling thousands of users working in multiple databases at the same time. Each instance of ,60 ,erver makes all databases in the instance available to all users that connect to the instance" subject to the defined security permissions. $hen connecting to an instance of ,60 ,erver" your connection is associated with a particular database on the server. This database is called the current database. %ou are usually connected to a database defined as your default database by the system administrator" although you can use connection options in the database +-Is to specify another database. %ou can switch from one database to another using either the Transact ,60 ),E database name statement" or an +-I function that changes your current database conte!t. ,60 ,erver GPPP allows you to detach databases from an instance of ,60 ,erver" then reattach them to another instance" or even attach the database back to the same instance. If you have a ,60 ,erver database file" you can tell ,60 ,erver when you connect to attach that database file with a specific database name. 0m(%eme#tatio# Detai%s The topics in this section provide information about the editions of /icrosoft2 ,60 ,erver7 GPPP and the environments that support these editions. Information about the ma!imum capacities and memory usage of ,60 ,erver GPPP objects is also provided. @.>.C Ma#a$i#$ Permissio#s $hen users connect to an instance of /icrosoft2 ,60 ,erver7" the activities they can perform are determined by the permissions granted to: Their security accounts. The /icrosoft $indows NT2 I.P or $indows2 GPPP groups or role hierarchies to which their security accounts belong. The user must have the appropriate permissions to perform any activity that involves changing the database definition or accessing data. /anaging permissions includes granting or revoking user rights to:

$ork with data and e!ecute procedures 'object permissions*. &reate a database or an item in the database 'statement permissions*. )tili#e permissions granted to predefined roles 'implied permissions*. O&Dect Permissio#s $orking with data or e!ecuting a procedure re@uires a class of permissions known as object permissions:

,E0E&T" IN,E;T" )-4+TE" and 4E0ETE statement permissions" which can be applied to the entire table and view. ,E0E&T and )-4+TE statement permissions" which can be selectively applied to individual columns of a table or view. ,E0E&T permissions" which may be applied to user defined functions. IN,E;T and 4E0ETE statement permissions" which affect the entire row" and therefore can be applied only to the table and view and not to individual columns. E.E&)TE statement permissions" which affect stored procedures and functions. Stateme#t Permissio#s +ctivities involved in creating a database or an item in a database" such as a table or stored procedure" re@uire a different class of permissions called statement permissions. For e!ample" if a user must be able to create a table within a database" then grant the &;E+TE T+=0E statement permission to the user. ,tatement permissions" such as &;E+TE 4+T+=+,E" are applied to the statement itself" rather than to a specific object defined in the database. ,tatement permissions are:

=+&?)- 4+T+=+,E =+&?)- 03( &;E+TE 4+T+=+,E &;E+TE 4EF+)0T &;E+TE F)N&TI3N &;E+TE -;3&E4);E &;E+TE ;)0E &;E+TE T+=0E &;E+TE <IE$ 0m(%ie+ Permissio#s Implied permissions control those activities that can be performed only by members of predefined system roles or owners of database objects. For e!ample" a member of the s'sa+mi# fi!ed server role inherits automatically full permission to do or see anything in a ,60 ,erver installation. 4atabase object owners also have implied permissions that allow them to perform all activities with the object they own. For e!ample" a user who owns

a table can view" add" or delete data" alter the table definition" or control permissions that allow other users to work with the table. Gra#ti#$ Permissio#s (rant statement and object permissions that allow a user account to: -erform activities or work with data in the current database. ;estrict them from activities or information not part of their intended function. For e!ample" you may be inclined to grant ,E0E&T object permission on the (a'ro%% table to all members of the (erso##e% role" allowing all members of (erso##e% to view (a'ro%%. /onths later" you may overhear members of (erso##e% discussing management salaries" information not meant to be seen by all (erso##e% members. In this situation" grant ,E0E&T access to (erso##e% for all columns in (a'ro%% e!cept the sa%ar' column. Note6 It is possible to grant permissions only to user accounts in the current database" for objects in the current database. If a user needs permissions to objects in another database" create the user account in the other database" or grant the user account access to the other database" as well as the current database. ,ystem stored procedures are the e!ception because E.E&)TE permissions are already granted to the (!&%ic role" which allows everyone to e!ecute them. 1owever" after E.E&)TE has been issued" the system stored procedures check the user8s role membership. If the user is not a member of the appropriate fi!ed server or database role necessary to run the stored procedure" the stored procedure will not continue. Re)o i#$ Permissio#s %ou can revoke a permission that has been granted or denied previously. ;evoking is similar to denying in that both remove a granted permission at the same level. 1owever" although revoking permission removes a granted permission" it does not prevent the user" group" or role from inheriting a granted permission from a higher level. Therefore" if you revoke permission for a user to view a table" you do not necessarily prevent the user from viewing the table because permission to view the table was granted to a role to which he belongs. For e!ample" removing ,E0E&T access on the Em(%o'ees table from the 3!ma#Reso!rces role revokes permission so that 3!ma#Reso!rces can no longer use the table. If 3!ma#Reso!rces is a member of the A+mi#istratio# role. If you later grant ,E0E&T permission on Em(%o'ees to A+mi#istratio#" members of 3!ma#Reso!rces can see the table through their membership in A+mi#istratio#. 1owever" if you deny permission to 3!ma#Reso!rces" the permission is not inherited if later granted to A+mi#istratio# because the deny permission cannot be undone by a permission at a different level. ,imilarly" it is also possible to remove a previously denied permission by revoking the deny for the permission. 1owever" if a user has other denied permissions at the group or role level" then the user still is denied access.

Note6 %ou can revoke permissions to user accounts only in the current database" for objects in the current database. @.>.E. Permissio#s for User*Defi#e+ F!#ctio#s Functions are subroutines made up of one or more Transact ,60 statements that can be used to encapsulate code for reuse. /icrosoft2 ,60 ,erver7 GPPP allows users to create their own user defined functions. )ser defined functions are managed through the following statements: &;E+TE F)N&TI3N" which creates a user defined function. +0TE; F)N&TI3N" which modifies user defined functions. 4;3- F)N&TI3N" which drops user defined functions. Each fully @ualified user defined function 'databaseRname.ownerRname.functionRname* must be uni@ue. name

+ou must ha e been !ranted ,-.AT. '/0,T)O0 permissions to create, alter, or drop userdefined functions. /sers other than the owner must be !ranted .".,/T. permission on a function %if the function is scalar- alued& before they can use it in a Transact-*1$ statement. )f the function is table- alued, the user must ha e *.$.,T permissions on the function before referencin! it. )f a ,-.AT. TA2$. or A$T.- TA2$. statement references a user-defined function in a ,H.,3 constraint, a D.'A/$T clause, or a computed column, the table owner must also own the function. )f the function is bein! schema-bound, you must ha e -.'.-.0,. permission on tables, iews, and functions referenced by the function.

You might also like