Creating an Aspnet Web Application

To start a new web application, open the New Project dialog either by selecting File New Project or by clicking the New Project button on the Visual Studio Start Page. If you don't see the Start page, you can always open it by choosing Help Show Start Page. With Visual C Projects selected in the left pane as the Project Type, choose ASP.NET Web Application from the right pane as the project template, as shown in Figure 2.3. In the New Project dialog, name the project using the Location box. As...

Exposing a Private Message Queue Using a Web Service

In Chapter 11, Messaging, I showed you how to use message queues to create distributed applications. These distributed applications could start and stop activities by themselves sending and receiving messages. I did note in Chapter 11 that a drawback to using the messaging application included with Windows as part of an application's architecture is that it limits distributed applications to those running on Windows. This objection can easily be overcome by exposing messaging as a web service....

Implementing a Web Service that Supports Transactions

To start with, make sure that Distributed Transaction Coordinator is running in SQL Server. You can do this from the Services applet in Administrative tools, or by using SQL Server's Enterprise Manager. In Enterprise Manager, expand the Support Services folder (see Figure 13.17), and right-click Distributed Transaction Coordinator to start it (if it isn't already). 7m twolt R t Mon Jt sqt Swww 5QI Serw Croup sgl 5IRVIR ( Mftrtrttwj Tr-sftMcton CowdkHater 0 Hems- 1 IGwAiiM. - r J hv.rz i ter-m 1...

Making a Square Window Round

Next, within the form class code, create a procedure, ApplyInitialRegion. Within ApplyInitialRegion, define a GraphicsPath object using its AddEllipse method, and assign it to the Region property of the Form object. GraphicsPath myGraphicsPath new GraphicsPath myGraphicsPath.AddEllipse new Rectangle 0, 0, 600, 450 this.Region new Region myGraphicsPath All that remains is to create a way to call the form, which you can do in a button Click event, as shown in Listing 3.9. When the click event is...

Creating a Nonzero Lower Bound

I teased you towards the beginning of the chapter by saying I would show you how to create an array with a non-zero lower bound. Here goes Warning You probably won't want to use non-zero lower bounds very often in C , because arrays created in the way shown in this example do not have many of the conveniences-such as square bracket notation-that we've come to expect when working with arrays. First, you need to create two integer arrays. The first array is used to store in its elements the size...

Programmatically Creating and Validating a Schema

Before I show you how to use the XmlSchema class to create and validate a schema, let's define the schema manually. To put the cart even further before the horse, let's first create some XML that we'd like to be the basis for the schema, and describe how we'd like the XML to work in fact, this is likely to be the way schemas are created in the real world . My XML excerpt describes a product, which is an element that is a complex type. Each product must have an integer product identification...

Using the WSDL Utility

To invoke the WSDL utility, wsdl.exe, first open the Visual Studio .NET Command Prompt window. You'll find it on your Windows Start menu under Microsoft Visual Studio .NET Visual Studio .NET Tools. To see all the command-line switches available with the utility, at the prompt type wsdl and press Enter. To create a proxy, enter wsdl, followed by the language choice CS for C and VB for Visual Basic , and then the URL of the web service with WSDL appended. For example wsdl language CS wsdl...

Implementing the ICarnivore Interface

Kicking this all up a notch, let's implement our own interface. Since it is ours, we get to name it and to define its members. Let's make an ICarnivore interface that consists of the Boolean property EatMeat already implemented in the Dinosaur class and a Boolean method CanIEatU, which determines whether one dinosaur instance can eat another. Listing 9.11 shows the interface definition. Note It's worth saying explicitly that the interface definition only defines the members required for the...