An Overview of OLEDB and ADO

One of the more confusing things about working with ADO is understanding that it's not the lowest rung on the ladder. OLE-DB is the basis for anything you do with ADO it provides the basis for communication with the database. ADO is simply a nice wrapper around the services that OLE-DB provides. In fact, you can even bypass ADO and go right to OLE-DB if you want to. However, using ADO will help you to develop applications much faster. The following sections will help you understand both OLE-DB...

User Control Example

User controls aren't controls in the same sense as controls that you might have created using Visual C++ in the past. You use them like controls, but actually they're composites of other controls. A user control represents a method of bundling some level of control functionality and then using it within a form. User controls have the same functionality as the COM controls you created in the past, but you'll notice they require a lot less work to create. You begin developing a user control by...

Script Based Example for Batch Jobs

Many console applications begin and end their existence at the command line because the developer doesn't need them for any other purpose. However, as network administrators begin to write more script applications, the need for console applications that can perform some type of generic low-level work increases. The console application becomes a black box that accepts some input from the network administrator, then provides a single output in the form of a return value. Often, the return value...

Windows Security Example

You'll run into more than a few situations when you must gain access to one or more types of security information that the .NET Framework doesn't provide. For example, you might need to know the security information for the local user. The previous sections discussed some of this information and how you can use it to improve your applications. Unfortunately, the functions required to access those security features reside in one or more C libraries such as ADVAPI32.LIB. This file is only...

Active Directory Programming Example

The example application performs some essential Active Directory tasks. It will accept a general query for user names that you'll use to select an individual user. The application will use this information to create a specific user query, then display certain information about that user including their department and job title. Active Directory also provides a note field for each user entry that you can use to make comments. The application will enable you to view the current comment and modify...

Creating the Component

This example shows you how to create a simple single node MMC snap-in that displays GetComputerNameEx() outputs. As a result, we won't be doing anything with the MMC Scope Pane. There are two main sections of code for the component portion of this example. The first processes event MMC requests. The second displays the requested data. In most circumstances, you could combine these two tasks into one method call. However, MMC uses a callback mechanism to display items within the Result View...

Understanding the Advantages of Data Caching in Web Applications

One of the most popular techniques for improving the performance of ASP applications is data caching. For example, if the contents of a database are fairly static, an application can improve its performance by caching the data locally, rather than incurring the cost of requesting a fresh copy of the database for each user request. In addition to saving the time required to make the call to the database, using data caching techniques can save resources on the back-end server. You can find out...

Understanding the Windows Security API

The Windows security API is vast and performs many functions within the operating system and the applications it supports. We're going to talk about two essential topics in this portion of the chapter. The first section is an overview of the security API from a programmer's perspective. While the user may be faintly aware that there's a security API, they're unlikely to use it or even care that it exists. As a programmer, you need to be very aware of this part of Windows 2000 and know how to...

Testing Using NUnit

As you create more application code and the code becomes more complex, it becomes important to have a good testing tool. Microsoft does provide some rudimentary testing tools with Visual Studio .NET, but most of these tools appear with the Enterprise Architect Edition and don't provide much in the way of automation. Consequently, third-party developers have filled in the gaps by creating automated tools for the developer. NUnit represents one of the tools that fill this gap. You'll find this...

Developer Productivity Enhancements

There's one overriding reason to use C -it's the language of choice for many developers who work extensively with COM or other object-based development technologies. Spending even a small amount of time on the microsoft.public.dotnet.vb.general, and microsoft.public.dotnet.vc.general newsgroups shows widespread developer interest in C as a language. (You can find all of these newsgroups on the news news.microsoft.com server, if you can't find them on your local ISP.) Many developers on these...

Validator Example

Now it's time to apply what you've learned so far. This example concentrates on using validators under various conditions. In fact, we'll use all four of the common validators described in the previous section. Figure 15.2 shows the layout for a web page. f USUS poukk ji vjijr fee Use f-tfl bi44 fr-tiMc ibj-rsf Ttil Yc-UflSUtlfiMbiil JUjililtga V t-jr .CWtcfi fl aa-J J j'-'.-u jiiaji .ron'ji j vjiiji fef iLc ittofuLapti field briber Lbifcc Tht _ flta iir iK ri iiVrr nw 1pre Ar Kvi far ins ' r-u...

Understanding Data Manipulation

Before you can manipulate application data, you need a recordset and a connection to the database. Developers use different techniques for gaining access to the data they require but, in most cases, you'll find that creating a global connection and recordset is the easiest method of performing this task. In addition, this technique generally produces the most efficient code. The following code shows what you'll need to add to the MainForm constructor to create the global database and print...

Dissecting the SOAP Message

You can divide SOAP messages into two basic categories requests and responses. The client sends a request to the server. If the server can fulfill the request, then it sends a data message back to the client. Otherwise, the server sends an error message indicating why it couldn't send a response back to the client. In most cases, the problem is one of security, access, equipment failure, or an inability to find the requested object or data. SOAP messages don't exist within a vacuum. If you send...

Understanding Critical Sections

A critical section is a piece of code or a variable that application threads can only access one thread at one time. If two applications require access to the same critical section, the first to make the request will obtain access. The second application will wait until the first application completes its task. In short, critical sections create bottlenecks in your code and can affect performance if you're not careful. Some forms of critical section ensure that the thread completes code...

Accelerators and Menus

Menus come in a variety of shapes and sizes. All SDI and MDI applications require a main menu. This menu normally contains a File entry, as well as some form of Help. However, Visual Studio .NET provides you with a clean slate when you create a menu, so the contents are completely up to you. Following the pattern used by existing applications is good practice because using a standard menu template makes it easier for others to learn your application. Another typical menu type is the context...

Using the Antechinus C Editor

Many developers have expressed dissatisfaction with the editor provided with Visual Studio .NET for C development, which isn't a surprise for anyone who's developed applications for long. The editor, along with other tools such as third-party libraries, represents the developer's custom tool for creating code. Since each one of us is different, it's not surprising that a one-size-fits-all approach to the editor doesn't work. More than a few developers are also looking for alternatives to the...

ADSI Viewer

The Active Directory Services Interface ADSI Viewer enables you to see the schema for Active Directory. The schema controls the structure of the database. Knowing the schema helps you to work with Active Directory, change its contents, and even add new schema elements. In order to control the kinds of data stored for the applications you create, you must know the Active Directory schema. Otherwise, you could damage the database given sufficient rights or, at least, prevent your application from...