Monday 31 December 2007

theForger's Win32 API Programming Tutorial

WinProg

Welcome to theForger's Win32 API Tutorial

This tutorial attempts to get you started developing with the Win32 API as quickly and clearly as possible.

Download Full Example Code
The tutorial text does not include the full code, you will need to download this to compile the examples.

This tutorial is meant to be read as a whole

Please read it from beginning to end before asking questions... most of them will probably be answered. Each section builds on the sections before it. I have also added some solutions to common errors in Appendix A. If you ask me a question that is answered on this page, you will look very silly.

If you are viewing this locally or on another website, visit the #winprog website for the current official copy.

Sunday 23 December 2007

Updating the UI from a Secondary Thread

[Full article]In my January 2004 column I discussed the use of delegates to execute a method asynchronously. I showed you that it's relatively easy to call BeginInvoke on a delegate object from the code behind a Windows® Form in order to dispatch an asynchronous method call. You also saw how to set up a callback method that fires automatically when the asynchronous method call completes its execution. However, I stopped short of talking about how you should update the UI to tell the user that the work is complete.
Updating user interface elements from a secondary thread in Windows Forms is tricky because a secondary thread is not allowed to read or write property values directly from a form or any of its child controls. This restriction exists because form objects and control objects in Windows Forms are not thread-safe. The only thread that's allowed to directly access a property value of a form or one of its controls is the primary UI thread. You must learn how to update the user interface without breaking this rule.
The technique you're going to learn here involves writing code to switch control to the primary UI thread from the secondary thread where it's executing—a process known as marshaling. This will allow you to update the UI safely and reliably. Once you switch control from a secondary thread to the primary UI thread, you are free to change any property values of a form and its child controls.

Asynchronous method execution using delegates

[Full article]This month I'll discuss the use of delegates to execute a method in an asynchronous fashion. I'll assume that you already know the fundamentals of programming with delegates, but if not, you should read the December 2002 and January 2003 Basic Instincts columns.
There are a number of scenarios in which asynchronous execution can be a valuable design technique. For example, you should use asynchronous execution in a Windows® Forms application when you want to execute a long-running command without blocking the responsiveness of the user interface. As you will see, programming with delegates makes it relatively easy to run a command asynchronously on a secondary thread. That means you can build a Windows Forms application that executes long-running calls across the network without freezing the user interface.
Executing methods asynchronously can also serve as a useful technique for a server-side application. Imagine you are writing the code behind an ASP.NET page to service a client request. What should you do if your code needs to execute two or more time-consuming calls across a network? For example, imagine you are required to write an ASP.NET page that must run a query against a remote database and also must execute a SOAP method on a remote Web Service to complete its work. If you don't use asynchronous method execution, you can only make one call across the network at a time. This means you can't start the second network call until the first network call returns. Asynchronous method execution using delegates lets you execute two or more network calls at the same time. This can significantly reduce the time it takes to process a server-side ASP.NET request, increasing the responsiveness of your application from the user's perspective.

Wednesday 19 December 2007

C# docking panel suit

http://sourceforge.net/projects/dockpanelsuite/

Thursday 13 December 2007

Skills measured by Exam 70-431Course 2778ECourse 2779Course 2780Installing and Configuring SQL Server 2005

Install SQL Server 2005.

Verify prerequisites.

Upgrade from an earlier version of SQL Server.

Create an instance.

Configure SQL Server 2005 instances and databases.

Configure log files and data files.

Configure the SQL Server DatabaseMail subsystem for an instance.

Choose a recovery model for the database.

Configure SQL Server security.

Configure server security principals.

Configure database securables.

Configure encryption.

Configure linked servers by using SQL Server Management Studio (SSMS).

Identify the external data source.

Identify the characteristics of the data source.

Identify the security model of the data source.

Implementing High Availability and Disaster Recovery

Implement database mirroring.

Prepare databases for database mirroring.

Create endpoints.

Specify database partners.

Specify a witness server.

Configure an operating mode.

Implement log shipping.

Initialize a secondary database.

Configure log shipping options.

Configure a log shipping mode.

Configure monitoring.

Manage database snapshots.

Create a snapshot.

Revert a database from a snapshot.

Supporting Data Consumers

Retrieve data to support ad hoc and recurring queries.

Construct SQL queries to return data.

Format the results of SQL queries.

Identify collation details.

Manipulate relational data.

Insert, update, and delete data.

Handle exceptions and errors.

Manage transactions.

Manage XML data.

Identify the specific structure needed by a consumer.

Retrieve XML data.

Modify XML data.

Convert between XML data and relational data.

Create an XML index.

Load an XML schema.

Implement an HTTP endpoint.

Create an HTTP endpoint.

Secure an HTTP endpoint.

Implement Service Broker components.

Create services.

Create queues.

Create contracts.

Create conversations.

Create message types.

Send messages to a service.

Route a message to a service.

Receive messages from a service.

Import and export data from a file.

Set a database to the bulk-logged recovery model to avoid inflating the transaction log.

Run the bcp utility.

Perform a Bulk Insert task.

Import bulk XML data by using the OPENROWSET function.

Copy data from one table to another by using the SQL Server 2005 Integration Services (SSIS) Import and Export Wizard.

Manage replication.

Distinguish between replication types.

Configure a publisher, a distributor, and a subscriber.

Configure replication security.

Configure conflict resolution settings for merge replication.

Monitor replication.

Improve replication performance.

Plan for, stop, and restart recovery procedures.

Maintaining Databases

Implement and maintain SQL Server Agent jobs.

Set a job owner.

Create a job schedule.

Create job steps.

Configure job steps.

Disable a job.

Create a maintenance job.

Set up alerts.

Configure operators.

Modify a job.

Delete a job.

Manage a job.

Manage databases by using Transact-SQL.

Manage index fragmentation.

Manage statistics.

Shrink files.

Perform database integrity checks by using DBCC CHECKDB.

Back up a database.

Perform a full backup.

Perform a differential backup.

Perform a transaction log backup.

Initialize a media set by using the FORMAT option.

Append or overwrite an existing media set.

Create a backup device.

Back up filegroups.

Restore a database.

Identify which files are needed from the backup strategy.

Restore a database from a single file and from multiple files.

Choose an appropriate restore method.

Move a database between servers.

Choose an appropriate method for moving a database.

Monitoring and Troubleshooting SQL Server Performance

Gather performance and optimization data by using the SQL Server Profiler.

Start a new trace.

Save the trace logs.

Configure SQL Server Profiler trace properties.

Configure a System Monitor counter log.

Correlate a SQL Server Profiler trace with System Monitor log data.

Gather performance and optimization data by using the Database Engine Tuning Advisor.

Build a workload file by using the SQL Server Profiler.

Tune a workload file by using the Database Engine Tuning Advisor.

Save recommended indexes.

Monitor and resolve blocks and deadlocks.

Identify the cause of a block by using the sys.dm_exec_requests system view.

Terminate an errant process.

Configure SQL Server Profiler trace properties.

Identify transaction blocks.

Diagnose and resolve database server errors.

Connect to a non-responsive server by using the dedicated administrator connection (DAC).

Review SQL Server startup logs.

Review error messages in event logs.

Monitor SQL Server Agent job history.

Identify the cause of a failure.

Identify outcome details.

Find out when a job last ran.

Gather performance and optimization data by using DMVs.

Creating and Implementing Database Objects

Implement a table.

Specify column details.

Specify the filegroup.

Assign permissions to a role for tables.

Specify a partition scheme when creating a table.

Specify a transaction.

Implement a view.

Create an indexed view.

Create an updateable view.

Assign permissions to a role or schema for a view.

Implement triggers.

Create a trigger.

Create DDL triggers for responding to database structure changes.

Identify recursive triggers.

Identify nested triggers.

Identify transaction triggers.

Implement functions.

Create a function.

Identify deterministic versus nondeterministic functions.

Implement stored procedures.

Create a stored procedure.

Recompile a stored procedure.

Assign permissions to a role for a stored procedure.

Implement constraints.

Specify the scope of a constraint.

Create a new constraint.

Implement indexes.

Specify the filegroup.

Specify the index type.

Specify relational index options.

Specify columns.

Specify a partition scheme when creating an index.

Disable an index.

Create an online index by using an ONLINE argument.

Create user-defined types.

Create a Transact-SQL user-defined type.

Specify details of the data type.

Create a CLR user-defined type.

Implement a full-text search.

Create a catalog.

Create an index.

Specify a full-text population method.

Sunday 9 December 2007

Basic of GDI+ and Graphics in ASP.NET

Introduction
In this article, I will explain about GDI+ in .NET Framework. If you haven't heard about GDI+, then GDI+ is a set of classes in .NET framework that deal with graphics. You can use GDI+ to draw custom drawing on the screen. GDI provides a layer of abstraction, hiding the differences between different video cards. You simply need to call the Windows API function to do the specific task, and internally the GDI figures out how to get to the client's particular video card to do whatever that you want.Although GDI exposes a relatively high level API to developers, it is still an API that based on the old Windows API with C style functions. GDI+ sits as a layer between GDI and your application providing more intuitive and inheritance based object model. GDI+ is generally considered a Windows technology. However, some of the new GDI+ features make this technology an excellent choice for Web applications, enabling developers to generate images, graphs, diagrams, and much more.


http://www.worldofasp.net/aspnet/Tutorials/GDI/Basic_of_GDI+_and_Graphics_in_ASP.NET_119.aspx

Wednesday 5 December 2007

TrueCrypt: Free open-source disk encryption software for Windows Vista/XP/2000 and Linux

T r u e C r y p t
Free open-source disk encryption software for Windows Vista/XP/2000 and Linux
Main Features:
Creates a virtual encrypted disk within a file and mounts it as a real disk.


Encrypts an entire hard disk partition or a storage device such as USB flash drive.


Encryption is automatic, real-time (on-the-fly) and transparent.


Provides two levels of plausible deniability, in case an adversary forces you to reveal the password:

1) Hidden volume (steganography – more information may be found here).

2) No TrueCrypt volume can be identified (volumes cannot be distinguished from random data).


Encryption algorithms: AES-256, Serpent, and Twofish. Mode of operation: LRW.
Further information regarding features of the software may be found in the documentation.

http://www.truecrypt.org/

Open Source Web Design

www.oswd.org

Tuesday 4 December 2007

Firefox Add-ons: Split Browser

This splits the content area of the browser window as you like.
This splits the content area of the browser window as you like. It will help you in various cases. For example, to compare multiple webpages, to show a calendar always, and so on.There is some ways to split window.* Choose the "Split Browser to" menu in the context menu.* Choose the "Load in Split Browser" menu in the context menu on link.* Click popup-button on top/bottom/left/right edges of the content area.* Drop links, bookmarks, etc. to popup-button on top/bottom/left/right edges of the content area while dragging.

https://addons.mozilla.org/en-US/firefox/addon/4287

Sunday 2 December 2007

Use TEXTCOPY to restore and retrieve images from a SQL Server Table

Storing and Retrieving Images From a SQL Server Table
by Gregory A. Larsen

Most applications use images of some kind, like a .jpg or .gif file. One application might only have a few images, while another application could have thousands of images. The images might only be read or written a few times, or be used frequently by an application. When an application needs to store images, you need to determine how best to store and manage your images. This article will show you how to insert and extract images from a SQL Server database as well as discuss issues related to storing your images in SQL server.
Advantages and Disadvantages of Storing Images in SQL Server
Even Microsoft does not recommend storing images in SQL Server, because this causes performance and database disk space issues. An application that stores images in a SQL Server database will experience performance problems each time an image is stored or retrieved from SQL Server because of the way SQL Server needs to store or retrieve images.
SQL Server needs to convert an image that is larger than 8K into multiple chunks, and then store these chunks on separate SQL Server pages. When SQL Server retrieves a large image stored in a database, the image must be retrieved in chunks and converted back into an image. This process of breaking up an image into chunks and reassembling these chunks back into images is what causes performance problems. Also, storing images in a database will make the database considerably larger, so backing up and restoring the database will take longer.
Knowing how often your application is going to insert, update, and select an image from a database might help you to determine how greatly performance will be degraded if you store your images in a SQL Server database. If you are only inserting the image once, and retrieving it rarely, then the performance hit will be minimal for each usage of an image. On the other hand, if your application is serving up a single image frequently, then the performance drain on SQL Server could be significant. When the performance impact is significant, it is best to just save the image natively in a file system and store only a pointer (a URL or an actual file location ) to the file in SQL server.
There are advantages to storing images in a SQL Server database, however. One advantage is that it simplifies managing the images. If you want to move your database to a different database server, it is as easy as copying the database. Another advantage of storing the images in SQL Server is the extra layer of security around the images. By storing images in SQL Server, you can manage access to images using SQL Server logins and roles. This extra layer of security makes it harder for an individual to gain access to your application images.
Using TEXTCOPY to Store and Retrieve an Image from SQL Server
SQL Server provides a binary named “TEXTCOPY” to import and export an image to and from SQL Server. This “.exe” is stored in the “…\MSSQL\Binn” directory. The following is the syntax for using this executable:TEXTCOPY [/S [sqlserver] ] [/U [login] ] [/P [password] ]
[/D [database] ] [/T table] [/C column] [/W"where clause"]
[/F file] [{/I /O}] [/K chunksize] [/Z] [/?]
/S sqlserver The SQL Server to connect to. If 'sqlserver' is not
specified, the local SQL Server is used.
/U login The login to connect with. If 'login' is not specified,
a trusted connection will be used.
/P password The password for 'login'. If 'password' is not
specified, a NULL password will be used.
/D database The database that contains the table with the text or
image data. If 'database' is not specified, the default
database of 'login' is used.
/T table The table that contains the text or image value.
/C column The text or image column of 'table'.
/W "where clause" A complete where clause (including the WHERE keyword)
that specifies a single row of 'table'.
/F file The file name.
/I Copy text or image value into SQL Server from 'file'.
/O Copy text or image value out of SQL Server into 'file'.
/K chunksize Size of the data transfer buffer in bytes. Minimum
value is 1024 bytes, default value is 4096 bytes.
/Z Display debug information while running.
/? Display this usage information and exit.
You can call this executable without any parameters or a subset of parameters. When you execute the “exe,” if there are any required parameters missing, you will be prompted to enter the missing parameters. The following is an example of a command that will save an image to SQL Server, and then one that will export an image to a file system from SQL Server.
First, I first need to insert an image. The following is an image named “c:\temp\glacier.jpg” that I will be storing:
This image will be stored in a table named “Image.” The statement I used to create this Image table can be found in weblisting1. To insert the “glacier.jpg” picture into my SQL Server table, I use the following command at the DOS prompt:C:\Program Files\Microsoft SQL Server\MSSQL\Binn\TEXTCOPY.exe" /S(local)
/Umylogin /Pmysapassword /D TEST /T Image /C Picture /F "C:\temp\glacier.jpg"
/W"where Title='glacier'" /I
This example, when executed by the DOS command shell, copies the image “glacier.jpg” into a table “Image” into a database I created and named “TEST.” With this command, I can log on to my local SQL Server database using a SQL Server login named “mylogin.” Note that the TEXTCOPY executable does not support Windows authentication. The “/W” parameter identifies a “WHERE” clause that will identify the single record to be updated in the “Image” table. The “/W” parameter is required to start, with “where” followed by a criteria that will identify a single record. The TEXTCOPY .exe requires that a shell record be already stored in the “Image” table so that it can updated. This shell record is the record identified by the /W parameter. In this shell record, the image column “Picture” must have a non-null value. I used the following code to create the shell record prior to running the TEXTCOPY command above:insert into Image(Picture,Title) values(0x0,'Glacier')
If there is no shell record for TEXTCOPY to update, then you will get the following error:TEXTCOPY Version 1.0
DB-Library version 8.00.194
ERROR: Row retrieval failed.
If you have created the shell record, but the Picture column is NULL, the following error will be displayed:TEXTCOPY Version 1.0
DB-Library version 8.00.2039
ERROR: Text or image pointer and timestamp retrieval failed.
If you are storing images in SQL Server, you will probably also need to retrieve them. TEXTCOPY can be used to create a file from an image stored in SQL Server. An example follows of how to use TEXTCOPY to retrieve the glacier picture from SQL Server and save it to a file:"C:\Program Files\Microsoft SQL Server\MSSQL\Binn\TEXTCOPY.exe" /S(local)
/Umylogin /Pmysapassword /D TEST /T Image /C Picture /F
"C:\temp\glacier_out.jpg" /W"where Title='glacier'" /O
The only difference between this command and the one that saved the image into SQL Server is that the “/O” option was used, instead of the “/I” option. Note that if you try to create an output file and the image doesn’t exist, the process will successfully complete, but the file will be zero bytes in length.
As you can see, the TEXTCOPY executable allows you to copy a single image to or

Saturday 1 December 2007

.Net programming standards and name conventions

.Net programming standards and name conventions

Guidelines – a hidden feature for the Visual Studio Editor

Update 12/2/2004: Uploaded an image from Visual Studio 2005 Beta. Note the image below shows guidelines at column numbers 5 and 30, but the regkey value is RBG(255,0,0), 4, 29. The Guideline column numbers are 0-based in the registry.



Update 11/29/2004: I've corrected the two (embarrassing) typos below. I must have had thanksgiving dinner on the brain at the time. 1. The reg key is [HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor (note the space between Text and Editor). 2. It's RGB, not RBG. The example had a typo, but it is now corrected.

Guidelines are visible column indicators for the VS Editor. During the last test pass, I came across a test case named “Guidelines” which got my immediate attention. I never heard of this before, so I made sure to spend extra time testing this cool, but hidden little feature during the Beta test pass. I didn’t find any issues with it, so I feel it is safe to share. Let me know if you run into any issues with it.



Warning! To enable guidelines, you’ll need to modify your registry settings. Follow the instructions below at your own risk.



Enabling Guidelines



First, shut down Visual Studio 2005 if already started.



Under

[HKEY_CURRENT_USER]\Software\Microsoft\VisualStudio\8.0\Text Editor

Create a string value called

Guides



Set Guides to the following

RGB(x,y,z) n1,...,n13

Where x,y,z are the RGB values and n is the column number. You can have at most 13 guidelines.



For example,

Guides = RGB(128,0,0) 5, 80

will place a Red guideline at column numbers 5 and 80.



And now launch VS and open a text file.



Disabling Guidelines



An obvious no-brainer, just delete the Guides keys you created above. Restart VS, and no more guidelines.

Saturday 24 November 2007

Compare VS2005 with VS2008

Full article is here
Should I stay or should I go … with Visual Studio 2005 or 2008 is the question in this particular case. One of my customers is still on Visual Studio 2003 and they are wondering whether to upgrade to VS 2005 or to VS 2008.

Are there reasons for moving to VS 2005 instead of 2008 even though 2008 is so close to release? Minimizing risk is probably the major driver for deciding on VS 2005. After all, it’s been out in the market for almost two years and it’s stable and mature. There’s also the common wisdom that you shouldn’t deploy a Microsoft product that doesn’t have at least one service pack. Mind you that SP1 for Visual Studio didn’t come out until 12 months after the release of the product. Microsoft is no longer in the mode where the Service Pack has to hit 6 months after release because there were quality issues that needed to be fixed.

When it comes to determining to move to the newer Visual Studio 2008 and the .NET Framework 3.5 there are more points to consider:

1) Stability and maturity of the underlying framework and consequently the applications you’re building on top of the framework.

2) Stability and maturity of new features added with VS 2008

3) Product Support differences.

4) Productivity benefits of VS 2008 compared to VS 2005.

Tuesday 20 November 2007

Adding ASP.NET AJAX to an Existing ASP.NET Application

Adding ASP.NET AJAX to an Existing ASP.NET Application

Introduction
ASP. NET AJAX makes it easily to take advantage of AJAX techniques and enables you to create ASP.NET pages, and enables you to take full advantage of the capabilities of the browser to deliver richer Web experiences that work on any modern browser.

Monday 19 November 2007

Advanced Unit Testing

Advanced Unit Testing is a unit test engine that provides features that go beyond other unit test engines such as NUnit and CSUnit. Conversely, certain features, most notably a command line driven interface, do not exist in AUT.

Sunday 18 November 2007

Implementing Client Callbacks Without Postbacks in ASP.NET Web Pages

Implementing Client Callbacks Without Postbacks in ASP.NET Web Pages

Paging through lots of data efficiently (and in an Ajax way) with ASP.NET 2.0

Paging through lots of data efficiently (and in an Ajax way) with ASP.NET 2.0

ASP.NET Best Practices for High Performance Applications

ASP.NET Best Practices for High Performance Applications
Introduction
ASP.NET is much more powerful than classic ASP, however it is important to understand how to use that power to build highly efficient, reliable and robust applications. In this article, I tried to highlight the key tips you can use to maximize the performance of your ASP.NET pages. The list can be much longer, I am only emphasizing the most important ones.

Monday 12 November 2007

SQL Server Query Execution Plan Analysis Part4/4

Sometimes, the Query Optimizer will need to create a temporary worktable in the tempdb database. If this is the case, it will be indicated in the graphical query execution plan with an icon labeled like this: Index Spool, Row Count Spool, or Table Spool.

Anytime a worktable is used, performance is generally hurt because of the extra I/O required to maintain the worktable. Ideally, there should be no worktables. Unfortunately, they cannot always be avoided. And sometimes their use can actually boost performance because using a worktable is more efficient that alternatives.

In any event, the use of a worktable in a graphical query execution plan should raise an alert with you. Take a careful look at such a query and see if there is anyway it can be rewritten to avoid the worktable. There may not be. But if there is, you are one step closer to boosting the performance of the query. [7.0, 2000, 2005] Updated 7-10-2006

*****

In a graphical query execution plan, often you see the Stream Aggregate icon. This just means that some sort of aggregation into a single input is being performed. This is most commonly seen when a DISTINCT clause is used, or any aggregation operator, such as AVG, COUNT, MAX, MIN, or SUM. [7.0, 2000, 2005] Updated 7-10-2006

*****

Query Analyzer and Management Studio are not the only tools that can generate and display query execution plans for queries. The SQL Server Profiler can also display them, albeit in text format only. One of the advantages of using Profiler instead of Query Analyzer or Management Studio to display execution plans is that it can do so for a great many queries from your actual production work, instead of running one at a time.

To capture and display query execution plans using Profiler, you must create a trace using the following configuration:

Events to Capture

Performance: Execution Plan
Performance: Show Plan All
Performance: Show Plan Statistics
Performance: Show Plan Text
Data Columns to Display

StartTime
Duration
TextData
CPU
Reads
Writes
Filters

Duration. You will want to specify a maximum duration, such as 5 seconds, so that you don't get flooded with too much data.
Of course, you can capture more information than is listed above in your trace; the above is only a guideline. But keep in mind that you don't want to capture too much data, as this could have a negative affect on your server's performance as the trace is being run. [7.0, 2000, 2005] Updated 7-10-2006

*****

If you use the OPTION FAST hint in a query, be aware that the Execution Plan results may not be what you expect. The Execution Plan that you get is based on the results of using the FAST hint, not the actual Execution Plan for the full query.

The FAST hint is used to tell the Query Optimizer to return the specified number of rows as fast as possible, even if this hurts the overall performance of the query. The purpose of this hint is to return a specified number of records quickly in order to produce an illusion of speed for the user. Once the specified number of rows is returned, the remaining rows are retuned as they would be normally.

So if you are using the FAST hint, the execution plan will be for only those rows that are returned FAST, not for all of the rows. If you want to see the execution plan for all the rows, then you must perform an Execution Plan of the query with the hint removed.

SQL Server Query Execution Plan Analysis Part3/4

In most cases, the query optimizer will analyze joins and JOIN the tables using the most efficient join type, and in the most efficient order. But not always. In the graphical query plan you will see icons that represent the different types of JOINs used in the query. In addition, each of the JOIN icons will have two arrows pointing to it. The upper arrow pointing to the JOIN icon represents the outer table in the join, and the lower arrow pointing to the JOIN icon represent the inner table in the join. Follow the arrows back to see the name of the tables being joined.

Sometimes, in queries with multiple JOINs, tracing the arrow back won't reveal a table, but another JOIN. If you place the cursor over the arrows pointing to the upper and lower JOINs, you will see a popup window that tells you how many rows are being sent to the JOIN for processing. The upper arrow should always have fewer rows than the lower arrow. If not, then the JOIN order selected by the query optimizer might be incorrect (see more on this below).

First of all, let's look at JOIN types. SQL Server can JOIN a table using three different techniques: nested loop, hash, and merge. Generally, the fastest type of join in a nested loop, but if that is not feasible, then a hash JOIN or merge JOIN is used (as appropriate), both of which tend to be slower than the nested JOIN.

When very large tables are JOINed, a merge join, not a nested loop join, may be the best option. The only way to know is to try both and see which one is the most efficient.

If a particular query is slow, and you suspect it may be because the JOIN type is not the optimum one for your data, you can override the query optimizer's choice by using a JOIN hint. Before you use a JOIN hint, you will want to take some time to learn about each of the JOIN types and how each one works. This is a complicated subject, beyond the scope of this tip.

JOIN order is also selected by the query optimizer, which it trying to select the most efficient order to JOIN tables. For example, for a nested loop join, the upper table should be the smaller of the two tables. For hash joins, the same is true; the upper table should be the smaller of the two tables. If you feel that the query optimizer is selecting the wrong order, you can override it using JOIN hints.

In many cases, the only way to know for sure if using a JOIN hint to change JOIN type or JOIN order will boost or hinder performance is to give them a try and see what happens. [7.0, 2000, 2005] Updated 5-15-2006

*****

If your SQL Server has multiple CPUs, and you have not changed the default setting in SQL Server to limit SQL Server's ability to use all of the CPUs in the server, then the query optimizer will consider using parallelism to execute some queries. Parallelism refers to the ability to execute a query on more than one CPU at the same time. In many cases, a query that runs on multiple processors is faster than a query that only runs on a single processor, but not always.

The Query Optimizer will not always use parallelism, even though it potentially can. This is because the Query Optimizer takes a variety of different things into consideration before it decides to use parallelism. For example, how many active concurrent connections are there, how busy is the CPU, is there enough available memory to run parallel queries, how many rows are being processed, and what is the type of query being run? Once the Query Optimizer collects all the facts, then it decides if parallelism is best for this particular run of the query. You may find that one time a query runs without parallelism, but later, the same query runs again, but this time, parallelism is used.

In some cases, the overhead of using multiple processors is greater than the resource savings of using them. While the query processor does try to weigh the pros and cons of using a parallel query, it doesn't always guess correctly.

If you suspect that parallelism might be hurting the performance of a particular query, you can turn off parallelism for this particular query by using the OPTION (MAXDOP 1) hint.

The only way to know for sure is to test the query both ways, and see what happens. [7.0, 2000, 2005] Updated 5-15-2006

*****

When you review a graphical execution plan, you may notice that the text of a icon is displayed in red, not black, which is the normal color. This means that the related table is missing some statistics that the Query Optimizer would like to have in order to come up with a better execution plan.

To create the missing statistics, you need to right-click on the icon and select "Create Missing Statistics." This will display the "Create Missing Statistics" dialog box, where you can then easily add the missing statistics.

If you are given the option to update missing statistics, you should always take the opportunity to do so as it will most likely benefit the performance of the query that is being analyzed. [7.0, 2000, 2005] Updated 5-15-2006

*****

Sometimes, when viewing a graphical query execution plan, you see an icon labeled "Assert." All this means is that the query optimizer is verifying a referential integrity or check constraint to see if the query will violate it or not. If not, there is no problem. But if it does, then the Query Optimizer will be unable to create an execution plan for the query and an error will be generated. [7.0, 2000, 2005] Updated 5-15-2006

*****

Often, when viewing a graphical query execution plan, you see an icon labeled "Bookmark Lookup." Bookmark lookups are quite common to see. Essentially, they are telling you that the Query Processor had to look up the row columns it needs from a heap or a clustered index, instead of being able to read it directly from a non-clustered index.

For example, if all of the columns in the SELECT, JOIN, and WHERE clauses of a query don't all exist in the non-clustered index used to locate the rows that meet the query's criteria, then the Query Optimizer has to do extra work and look at the heap or clustered index to find all the columns it needs to satisfy the query.

Another cause of a bookmark lookup is using SELECT *, which should never be used, as in most cases it will return more data that you really need.

Bookmark lookups are not ideal from a performance perspective because extra I/O is required to look up all the columns for the rows to be returned.

If you think that a bookmark lookup is hurting a query's performance, you have four potential options to avoid it. First, you can create a clustered index that will be used by the WHERE clause, you can take advantage of index intersection, you can create a covering non-clustered index, or you can (if you have SQL Server 2000/2005 Enterprise Edition, create an indexed view. If none of these are possible, or if using one of these will use more resources than using the bookmark lookup, then the bookmark lookup is the

SQL Server Query Execution Plan Analysis Part2/4

The arrows that connect one icon to another in a graphical query plan have different thicknesses. The thickness of the arrow indicates the relative cost in the number of rows and row size of the data moving between each icon. The thicker the arrow, the more the relative cost is.

You can use this indicator as a quick gauge as to what is happening within the query plan of your query. You will want to pay extra attention to thick arrows in order to see how it affects the performance of your query. For example, thick lines should be at the right of the graphical execution plan, not the left. If you see them on the left, this could indicate that too many rows are being returned, and that the query execution plan is less than optimal. [7.0, 2000, 2005] Updated 9-19-2005

*****

In an execution plan, each part of it is assigned a percentage cost. This represents how much this part costs in resource use, relative to the rest of the execution plan. When you analyze an execution plan, you should focus your efforts on those parts that have the largest percentage cost. This way, you focus your limited time on those areas that have the greatest potential for a return on your time investment. [7.0, 2000, 2005] Updated 9-19-2005

*****

In an execution plan, you may have noticed that some parts of the plan are executed more than once. As part of your analysis of an execution plan, you should focus some of your time on any part that takes more than one execution, and see if there is any way to reduce the number of executions performed. The fewer executions that are performed, the faster the query will be executed. [7.0, 2000, 2005] Updated 9-19-2005

*****

In an execution plan you will see references to I/O and CPU cost. These don't have a "real" meaning, such as representing the use of a specific amount of resources. These figures are used by the Query Optimizer to help it make the best decision. But there is one meaning you can associate with them, and that is that a smaller I/O or CPU cost uses less server resources than a higher I/O or CPU cost. [7.0, 2000, 2005] Updated 9-19-2005

*****

When you examine a graphical SQL Server query execution plan, one of the more useful things to look for are how indexes were used (if at all) by the query optimizer to retrieve data from tables from a given query. By finding out if an index was used, and how it was used, you can help determine if the current indexes are allowing the query to run as well as it possibly can.

When you place the cursor over a table name (and its icon) in a graphical execution plan and display the pop-up window, you will see one of several messages. These messages tell you if and how an index was used to retrieve data from a table. They include:

Table Scan: If you see this message, it means there was no clustered index on the table and that no index was used to look up the results. Literally, each row in the table had to be examined. If a table is relatively small, table scans can be very fast, sometimes faster than using an index.

So the first thing you want to do, when you see that a table scan has been performed, is to see how many rows there are in the table. If there are not many, then a table scan may offer the best overall performance. But if this table is large, then a table scan will most likely take a long time to complete, and performance will suffer. In this case, you need to look into adding an appropriate index(s) to the table that the query can use.

Let's say that you have identified a query that uses a table scan, but you also discover that there is an appropriate nonclustered index, but it is not being used. What does that mean, and why isn't the index being used? If the amount of data to be retrieved is large, relative to the size of the table, or if the data is not selective (which means that there are many rows with the same values in the same column), a table scan is often performed instead of an index seek because it is faster. For example, if a table has 10,000 rows, and the query returns 1,000 of them, then a table scan of a table with no clustered index will be faster than trying to use a non-clustered index. Or, if the table had 10,000 rows, and 1,000 of the rows have the same value in the same column (the column being used in the WHERE clause), a table scan is also faster than using a non-clustered index.

When you view the pop-up window when you move the cursor over a table in a graphical query plan, notice the "Estimated Row Count" number. This number is the query optimizer's best guess on how many rows will be retrieved. If a table scan was done, and this number is very high, this tells you that the table scan was done because a high number of records were returned, and that the query optimizer believed that it was faster to perform a table scan than use the available non-clustered index.
Index Seek: When you see this, it means that the query optimizer used a non-clustered index on the table to look up the results. Performance is generally very quick, especially when few rows are returned.
Clustered Index Seek: If you see this, this means that the query optimizer was able to use a clustered index on the table to look up the results, and performance is very quick. In fact, this is the fastest type of index lookup SQL Server can do.
Clustered Index Scan: A clustered index scan is like a table scan, except that it is done on a table that has a clustered index. Like a regular table scan, a clustered index scan may indicate a performance problem. Generally, they occur for two different reasons. First, there may be too many rows to retrieve, relative to the total number of rows in the table. See the "Estimated Row Count" to verify this. Second, it may be due to the column queried in the WHERE clause may not be selective enough. In any event, a clustered index scan is generally faster than a standard table scan, as not all records in the table always have to be searched when a clustered index scan is run, unlike a standard table scan. Generally, the only thing you can do to change a clustered index scan to a clustered index seek is to rewrite the query so that it is more restrictive and fewer rows are returned.

Sunday 11 November 2007

SQL Server Query Execution Plan Analysis Part1/4

When it comes time to analyze the performance of a specific query, one of the best methods is to view the query execution plan. A query execution plan outlines how the SQL Server query optimizer actually ran (or will run) a specific query. This information if very valuable when it comes time to find out why a specific query is running slow.

There are several different ways to view a query's execution plan. They include:

From within Query Analyzer is an option called "Show Execution Plan" (located on the Query drop-down menu). If you turn this option on, then whenever you run a query in Query Analyzer, you will get a query execution plan (in graphical format) displayed in a separate window.
If you want to see an execution plan, but you don't want to run the query, you can choose the option "Display Estimated Execution Plan" (located on the Query drop-down menu). When you select this option, immediately an execution plan (in graphical format) will appear. The difference between these two (if any) is accountable to the fact that when a query is really run (not simulated, as in this option), current operations of the server are also considered. In most cases, plans created by either method will produce similar results.
When you create a SQL Server Profiler trace, one of the events you can collect is called: MISC: Execution Plan. This information (in text form) shows the execution plan used by the query optimizer to execute the query.
From within Query Analyzer, you can run the command SET SHOWPLAN_TEXT ON. Once you run this command, any query you execute in this Query Analyzer sessions will not be run, but a text-based version of the query plan will be displayed. If the query you are running uses temp tables, then you will have to run the command, SET STATISTICS PROFILE ON before running the query.
Of these options, I prefer using the "Show Execution Plan", which produces a graphical output and considers current server operations. [7.0, 2000] Updated 8-5-2005

*****

If you see any of the following in an execution plan, you should consider them warning signs and investigate them for potential performance problems. Each of them are less than ideal from a performance perspective.

Index or table scans: May indicate a need for better or additional indexes.
Bookmark Lookups: Consider changing the current clustered index, consider using a covering index, limit the number of columns in the SELECT statement.
Filter: Remove any functions in the WHERE clause, don't include wiews in your Transact-SQL code, may need additional indexes.
Sort: Does the data really need to be sorted? Can an index be used to avoid sorting? Can sorting be done at the client more efficiently?
It is not always possible to avoid these, but the more you can avoid them, the faster query performance will be. [7.0, 2000, 2005] Updated 8-5-2005

*****

If you have a stored procedure, or other batch Transact-SQL code that uses temp tables, you cannot use the "Display Estimated Execution Plan" option in the Query Analyzer or Management Studio to evaluate it. Instead, you must actually run the stored procedure or batch code. This is because when a query is run using the "Display Estimated Execution Plan" option, it is not really run, and temp tables are not created. Since they are not created, any references to them in the code will fail, which prevents an estimated execution plan from being created.

On the other hand, if you use a table variable instead of a temp table, you can use the "Display Estimated Execution Plan" option [7.0, 2000, 2005] Updated 8-5-2005

*****

If you have a very complex query you are analyzing in Query Analyzer or Management Studio as a graphical query execution plan, the resulting plan can be very difficult to view and analyze. You may find it easier to break down the query into its logical components, analyzing each component separately. [7.0, 2000, 2005] Updated 8-5-2005

*****

The results of a graphical query execution plan are not always easy to read and interpret. Keep the following in mind when viewing a graphical execution plan:

In very complex query plans, the plan is divided into many parts, with each part listed one on top of the other on the screen. Each part represents a separate process or step that the query optimizer has to perform in order to get to the final results.
Each of the execution plan steps is often broken down into smaller sub-steps. Unfortunately, they are displayed on the screen from right to left. This means you must scroll to the far right of the graphical query plan to see where each step starts.
Each of the sub-steps and steps is connected by an arrow, showing the path (order) taken of the query when it was executed.
Eventually, all of the parts come together at the top left side of the screen.
If you move your cursor above any of the steps or sub-steps, a pop-up windows is displayed, providing more detailed information about this particular step or sub-step.
If you move your cursor over any of the arrows connecting the steps and sub-steps, you see a pop-up window showing how many records are being moved from one step or sub-step to another step or sub-step.

Thursday 8 November 2007

Microsoft ActiveX Control Pad

Microsoft ActiveX Control Pad

January 20, 1997

Microsoft® Internet Explorer 3.x and ActiveX™ technologies provide a smart, compelling Web development platform: Microsoft ActiveX Control Pad. The ActiveX Control Pad is an authoring tool that lets you add ActiveX controls and ActiveX scripting (Visual Basic® Scripting Edition (VBScript) or JScript) to your HTML pages with point-and-click ease.

The ActiveX Control Pad also includes the Microsoft HTML Layout Control, which provides layout capabilities based on the HTML extensions proposed by the World Wide Web Consortium (W3C). Using the ActiveX Control Pad, you can easily author pages that include advanced layout and multimedia features such as exact object placement, object layering, and transparency effects.

Tuesday 6 November 2007

Custom Http Handlers

The complete article
The concept of custom HTTP Handlers is not new, but is a bit overlooked one. Performance-wise, using custom HTTP Handler is an excellent choice over ASP.NET pages when you don't need the huge overhead of ViewStates, Page life cycle events and support for postback stuff etc.
Another extremely powerful, yet easily implementable use of a custom HTTP Handler is to process some resource or some type resources in your web site in special manner. E.g. You can restrict access to all *.txt file (no matter which web folder they are in) or if log.dat is requested then based upon valid role of the user, present the logged information from database etc.
In this article we'll create a HTTP Handler to resize an image as per parameters that user passes. I have used Ajax Slider control only for better UI. Then as an example of how HTTP Handler can be used to process a type of files, we would create another HTTP handler to restrict access to specific types of files types, just to get an idea of this type of application.

Monday 5 November 2007

CCleaner

Download
CCleaner (Crap Cleaner) removes all sorts of unused files, temp files, cookies, log files, cached files and other files from your computer. This is something that all computer users should do on a regular basis, not just to free up space on the hard drive but for better performace as well. A hard drive cleaner would be the first thing you would use when you have performance problems or system starts behaving erratically.

As hard drive cleaners go this is one of the coolest out there, not just because it is 100% free but because it is very fast and does the job efficiently and has a nice, intuitive interface.It also completely erases all internet “tracks”, including cookies and history files, protecting your privacy from anybody who might want to monitor your internet behavior. CCleaner works with IE, Firefox, and Opera. It will also automatically detect the recently used file lists of most installed applications and erase those tracks as well.

CCleaner also delivers 2 other functionalities as a registry cleaner and uninstaller. Although these both seem to work quite well, I must confess that I almost never use them, and it is the hard drive cleaning functionality that I makes me install and use this software. Having said that I will also admit that the registry cleaner seems to work quite well, in that it finds and resolve issues and does not seem to cause any undesirable side effects that are always a risk with registry cleaning tools in general. It also allows you to back up the registry before doing any intervention in case you wanted to undo these afterwards.

Note: this software will attempt to install the Yahoo toolbar (UK version) on your machine if you use the default install options, which is a bit annoying. If you don’t want this, make sure to uncheck the Yahoo toolbar checkbox in the install options.

EmEditor Text Editor

Welcome to EmEditor Text Editor Home Page!
EmEditor Text Editor is a lightweight yet extendable, easy-to-use text editor for Windows. EmEditor is very customizable, and it supports Unicode and powerful macros. EmEditor is designed for Windows XP, and certified for Windows Vista! The x64 Edition is also available!

http://www.emeditor.com/

Monday 15 October 2007

Outlook style navigation bar

Thursday 27 September 2007

SQL Data Types FAQ

1. What's the difference between CHAR and VARCHAR data types and when do I use them?

CHAR and VARCHAR data types are both non-Unicode character data types with a maximum length of 8,000 characters. The main difference between these 2 data types is that a CHAR data type is fixed-length while a VARCHAR is variable-length. If the number of characters entered in a CHAR data type column is less than the declared column length, spaces are appended to it to fill up the whole length.

Another difference is in the storage size wherein the storage size for CHAR is n bytes while for VARCHAR is the actual length in bytes of the data entered (and not n bytes).

You should use CHAR data type when the data values in a column are expected to be consistently close to the same size. On the other hand, you should use VARCHAR when the data values in a column are expected to vary considerably in size.


2. What's the difference between NCHAR and NVARCHAR data types and when do I use them?

NCHAR and NVARCHAR data types are both Unicode character data types with a maximum length of 4,000 characters. The main difference between these 2 data types is that an NCHAR data type is fixed-length while an NVARCHAR is variable-length. If the number of characters entered in an NCHAR data type column is less than the specified column length, spaces are appended to it to fill up the whole length.

Another difference is in the storage size wherein the storage size for NCHAR is two times n bytes while for NVARCHAR is two times the number of characters entered (in bytes).

You should use NCHAR data type when the data values in a column are expected to be consistently close to the same size. On the other hand, you should use NVARCHAR when the data values in a column are expected to vary considerably in size.


3. What's the difference between CHAR and NCHAR data types and when do I use them?

CHAR and NCHAR data types are both character data types that are fixed-length. Below is the summary of the differences between these 2 data types:

CHAR(n) NCHAR(n)
Character Data Type Non-Unicode Data Unicode Data
Maximum Length 8,000 4,000
Character Size 1 byte 2 bytes
Storage Size n bytes 2 times n bytes

You would use NCHAR data type for columns that store characters from more than one character set or when you will be using characters that require 2-byte characters, which are basically the Unicode characters such as the Japanese Kanji or Korean Hangul characters.


4. What's the difference between VARCHAR and NVARCHAR data types and when do I use them?

VARCHAR and NVARCHAR data types are both character data types that are variable-length. Below is the summary of the differences between these 2 data types:

VARCHAR(n) NVARCHAR(n)
Character Data Type Non-Unicode Data Unicode Data
Maximum Length 8,000 4,000
Character Size 1 byte 2 bytes
Storage Size Actual Length (in bytes) 2 times Actual Length (in bytes)

You would use NVARCHAR data type for columns that store characters from more than one character set or when you will be using characters that require 2-byte characters, which are basically the Unicode characters such as the Japanese Kanji or Korean Hangul characters.


5. What's the difference between TINYINT, SMALLINT, INT and BIGINT data types and when do I use them?

TINYINT, SMALLINT, INT and BIGINT are all the same in the sense that they are all exact number data types that use integer data. The difference between these data types are in the minimum and maximum values that each can contain as well as the storage size required by each data type, as shown in the following table:

Data Type Minimum Value Maximum Value Storage Size
tinyint 0 255 1 byte
smallint -2^15 (-32,768) 2^15 - 1 (32,767) 2 bytes
int -2^31 (-2,147,483,648) 2^31 - 1 (2,147,483,647) 4 bytes
bigint -2^63 (-9,223,372,036,854,775,808) 2^63 - 1 (9,223,372,036,854,775,807) 8 bytes

Choosing which of these data types to use depends on the value you want to store for the column or variable. The rule of thumb is to always use the data type that will require the least storage size. Don't always use INT as your data type for whole numbers if you don't need to. If you simply need to store a value between 0 and 255 then you should define your column as TINYINT.


6. What's the difference between NUMERIC and DECIMAL data types and when do I use them?

There is no difference between NUMERIC and DECIMAL data types. They are synonymous to each other and either one can be used. DECIMAL/NUMERIC data types are numeric data types with fixed precision and scale.

DECIMAL (p [, s ])
NUMERIC (p [, s ])
In declaring a DECIMAL or NUMERIC data type, p, which is the precision, specifies the maximum total number of decimal digits that can be stored, both to the left and to the right of the decimal point. The precision must be a value from 1 through the maximum precision of 38. The s is the scale and it specifies the maximum number of decimal digits that can be stored to the right of the decimal point. Scale, which defaults to 0 if not specified, must be a value from 0 to the precision value.

The following table specifies the storage size required based on the precision specified for the NUMERIC or DECIMAL data type:

Precision Storage Size
1 - 9 5 bytes
10- 19 9 bytes
20-28 13 bytes
29-38 17 bytes


7. What's the difference between FLOAT and REAL data types and when do I use them?

FLOAT and REAL data types are both approximate number data types for use with floating point numeric data. Floating point data is approximate; not all values in the data type range can be precisely represented. The differences between these 2 data types are in the minimum and maximum values each can hold as well as the storage size required, as specified in the following table:

Data Type n Minimum Value Maximum Value Precision Storage Size
float [(n)] 1-24 -1.79E + 308 1.79E + 308 7 digits 4 bytes
25-53 -1.79E + 308 1.79E + 308 15 digits 8 bytes
real -3.40E + 38 3.40E + 38 7 digits 4 bytes

For FLOAT data type, the n is the number of bits used to store the mantissa in scientific notation and thus dictates the precision and storage size and it must be a value from 1 through 53. If not specified, this defaults to 53. In SQL Server, the synonym for REAL data type is FLOAT(24). If your data requires only a maximum of 7 digits precision, you can either use the REAL data type or FLOAT data type with 24 as the parameter (FLOAT(24)).


8. What's the difference between SMALLDATETIME and DATETIME data types and when do I use them?

A datetime data type is date and time data from January 1, 1753 through December 31, 9999, to an accuracy of one three-hundredth of a second (equivalent to 3.33 milliseconds or 0.00333 seconds). Values are rounded to increments of .000, .003, or .007 seconds.

On the other hand, a smalldatetime data type is a date and time data from January 1, 1900, through June 6, 2079, with accuracy to the minute. smalldatetime values with 29.998 seconds or lower are rounded down to the nearest minute; values with 29.999 seconds or higher are rounded up to the nearest minute.

Values with the datetime data type are stored internally by Microsoft SQL Server as two 4-byte integers. The first 4 bytes store the number of days before or after the base date, January 1, 1900. The base date is the system reference date. Values for datetime earlier than January 1, 1753, are not permitted. The other 4 bytes store the time of day represented as the number of milliseconds after midnight.

The smalldatetime data type stores dates and times of day with less precision than datetime. SQL Server stores smalldatetime values as two 2-byte integers. The first 2 bytes store the number of days after January 1, 1900. The other 2 bytes store the number of minutes since midnight. Dates range from January 1, 1900, through June 6, 2079, with accuracy to the minute.

Data Type Minimum Value Maximum Value Time Accuracy Storage Size
smalldatetime January 1, 1900 June 6, 2079 up to a minute 4 bytes
datetime January 1, 1753 December 31, 9999 one three-hundredth of a second 8 bytes

smalldatetime is usually used when you don't need to store the time of the day such as in cases of effectivity dates and expiration dates. datetime is used if the time of the day is needed and up to the second accuracy is required.


9. What's the difference between SMALLMONEY and MONEY data types and when do I use them?

MONEY and SMALLMONEY are both monetary data types for representing monetary or currency values. The differences between these 2 data types are in the minimum and maximum values each can hold as well as in the storage size required by each data type, as shown in the following table:

Data Type Minimum Value Maximum Value Storage Size
smallmoney -214,748.3648 214,748.3647 4 bytes
money -2^63 (-922,337,203,685,477.5808) 2^63 - 1 (+922,337,203,685,477.5807) 8 bytes

Both SMALLMONEY and MONEY data types has an accuracy to a ten-thousandths of a monetary unit. The rule of thumb is to always use the data type that will require the least storage size. If the monetary value that you will store is less than 214,748.3647 then you should use SMALLMONEY; otherwise use the MONEY data type.


10. How do I store a boolean value in SQL Server?

In SQL Server, there's no boolean data type. The nearest data type that can be used in place of boolean data is the BIT data type, which is an integer data type that can accept a value of 1, 0 or NULL value only.

Wednesday 26 September 2007

Use Cassini to host ASP.Net 2.0

http://ultidev.com/Products/Cassini/CassiniDevGuide.htm

A post solve the problem "Failed to access IIS metadata"

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=240301&SiteID=1

Tuesday 25 September 2007

Study Mono

Go there to learn about Mono.
"Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix. Sponsored by Novell (http://www.novell.com), the Mono open source project has an active and enthusiastic contributing community and is positioned to become the leading choice for development of Linux applications. "

How to make Apache run ASP.NET / ASP.NET 2.0

Don’t ask me why… but i’ve been asked to make Apache run ASP.NET.

IT Worked !

Even worked with ASP.NET 2.0 Site !

Following are the instruction to make Asp.Net work under apache:

– Install Apache 2.0.54

– Install http://www.apache.org/dist/httpd/mod_aspdotnet/mod_aspdotnet-2.0.0.msi" target=_blank>Mod_AspDotNet

– Add at the end of C:\Program Files\Apache Group\Apache2\conf\httpd.conf the following lines

#asp.net
LoadModule aspdotnet_module "modules/mod_aspdotnet.so"

AddHandler asp.net asax ascx ashx asmx aspx axd config cs csproj licx rem resources resx soap vb vbproj vsdisco webinfo

<IfModule mod_aspdotnet.cpp>
# Mount the ASP.NET /asp application
AspNetMount /SampleASP "c:/SampleASP"
#/SampleASP is the alias name for asp.net to execute
#"c:/SampleASP" is the actual execution of files/folders in that location

# Map all requests for /asp to the application files
Alias /SampleASP "c:/SampleASP"
#maps /SampleASP request to "c:/SampleASP"
#now to get to the /SampleASP type
http://localhost/SampleASP">%20color=#009f00>http://localhost/SampleASP

#It' redirect FONT>http://localhost/SampleASP"> color=#009f00>http://localhost/SampleASP
to "c:/SampleASP"

# Allow asp.net scripts to be executed in the /SampleASP example
<Directory "c:/SampleASP">
Options FollowSymlinks ExecCGI
Order allow,deny
Allow from all
DirectoryIndex index.htm index.aspx
#default the index page to .htm and .aspx
</Directory>

# For all virtual ASP.NET webs, we need the aspnet_client files
# to serve the client-side helper scripts.
AliasMatch /aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*) "C:/Windows/Microsoft.NET/Framework/v$1.$2.$3/ASP.NETClientFiles/$4"
<Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">
Options FollowSymlinks
Order allow,deny
Allow from all
</Directory>
</IfModule>
#asp.net

– Create a directory c:\SampleASP and insert in it the index.aspx

– Restart apache server :
Start->
Apache HTTP Server 2.0.54 ->
Control Apache Server -> Restart

– Open Explorer and navigate to http://localhost/SampleASP/index.aspxhttp://localhost/SampleASP/index.aspx">http://localhost/SampleASP/index.aspx>%20

If%20everything%20worked%20fine%20you%20should%20get%20a%20nice%20asp.net%20page%20working.