Sunday, December 26, 2010

thumbnail

Passing Values between User Controls and ASPX Page

This article is for beginners who are learning. NET.This will be really helpful for them. Beginners will be wondered how to pass values between User Controls and ASPX page. In this article I have listed some of the ways through which you can access and set the User control values in an ASPX page. I started of with some of the basics, advantages and disadvantages of user controls.

User Control:

User Control is the custom, reusable controls. User Controls offers a way to partition and reuse User Interface (UI) functionality across ASP.NET Applications.

Advantages of User Control:

Code Reuse
Cache the output of the control independently using technique called fragment caching. This will improve performance if used appropriately.
Can program against any properties declared in the control, just like ASP.NET web controls.
Disadvantages of User Control:

User Controls can be instantiated in the pages that resides in the same web application. If you want to use across applications, you need to place same .ascx control

Can't hide code of user controls like server controls by compiling into an assembly.
Adding User Controls to an WebForms Page:

At the top of the .aspx page, add the below line above Html tag.

<%@ Register TagPrefix="Test" TagName="TestControl" Src="Test.ascx" %>

This directive registers the control so that it can be recognized when the page is processed. TagPrefix determines the unique namespace of the control, TagName is the name of the user control and Src is the path of the user control.

Declare user controls like



Accessing and Setting User Controls Values in the .aspx Page:

User can access and set the values of the User Control from .aspx page through properties,using javascript and in code-behind of aspx page.The details of it are shown below

1) Using Properties

If the test.ascx control has two textboxes and submit button.You can access the values of the textboxes in the control from an .aspx page by declaring public property in the .ascx page.

public string FirstName
{
get{return txtFirstName.Text;}
set{txtFirstName.Text = value;}
}

In .aspx page,you can access FirstName using

TestControl.FirstName

You can set the FirstName of the control from aspx page using

TestControl.FirstName = "Nasrullah"

2) Using Javascript

You can set the values of the controls declared in the .ascx page by

document.forms[0]['TestControl:txtFirstName'].value ="Nasrullah";

You can get the values of the controls declared in the .ascx page by

document.forms[0]['TestControl:txtFirstName'].value

3) In ASPX code behind file

TestControl objTestControl = (TestControl)Page.FindControl("TestControl");
TextBox objTextBox = objTestControl.FindControl("txtFirstName");
string strFirstName = objTextBox.Text;

This will find the control named TestControl declared in the aspx page and look for the TextBox named txtFirstName in the user control and instantiate object of it. In this way also you can access the value of the user control.This is not recommended as it consumes more memory.

Thursday, July 22, 2010

thumbnail

What is managed code?

Managed code is code that has its execution managed by the .NET Framework Common Language Runtime. It refers to a contract of cooperation between natively executing code and the runtime. This contract specifies that at any point of execution, the runtime may stop an executing CPU and retrieve information specific to the current CPU instruction address. Information that must be query-able generally pertains to runtime state, such as register or stack memory contents.

The necessary information is encoded in an Intermediate Language (IL) and associated metadata, or symbolic information that describes all of the entry points and the constructs exposed in the IL (e.g., methods, properties) and their characteristics. The Common Language Infrastructure (CLI) Standard (which the CLR is the primary commercial implementation) describes how the information is to be encoded, and programming languages that target the runtime emit the correct encoding. All a developer has to know is that any of the languages that target the runtime produce managed code emitted as PE files that contain IL and metadata. And there are many such languages to choose from, since there are nearly 20 different languages provided by third parties – everything from COBOL to Camel – in addition to C#, J#, VB .Net, Jscript .Net, and C++ from Microsoft.

Before the code is run, the IL is compiled into native executable code. And, since this compilation happens by the managed execution environment (or, more correctly, by a runtime-aware compiler that knows how to target the managed execution environment), the managed execution environment can make guarantees about what the code is going to do. It can insert traps and appropriate garbage collection hooks, exception handling, type safety, array bounds and index checking, and so forth. For example, such a compiler makes sure to lay out stack frames and everything just right so that the garbage collector can run in the background on a separate thread, constantly walking the active call stack, finding all the roots, chasing down all the live objects. In addition because the IL has a notion of type safety the execution engine will maintain the guarantee of type safety eliminating a whole class of programming mistakes that often lead to security holes.

Contrast this to the unmanaged world: Unmanaged executable files are basically a binary image, x86 code, loaded into memory. The program counter gets put there and that’s the last the OS knows. There are protections in place around memory management and port I/O and so forth, but the system doesn’t actually know what the application is doing. Therefore, it can’t make any guarantees about what happens when the application runs.
thumbnail

Common Language Specification

To fully interact with other objects regardless of the language they were implemented in, objects must expose to callers only those features that are common to all the languages they must interoperate with. For this reason, the Common Language Specification (CLS), which is a set of basic language features needed by many applications, has been defined. The CLS rules define a subset of the Common Type System; that is, all the rules that apply to the common type system apply to the CLS, except where stricter rules are defined in the CLS. The CLS helps enhance and ensure language interoperability by defining a set of features that developers can rely on to be available in a wide variety of languages. The CLS also establishes requirements for CLS compliance; these help you determine whether your managed code conforms to the CLS and to what extent a given tool supports the development of managed code that uses CLS features.

If your component uses only CLS features in the API that it exposes to other code (including derived classes), the component is guaranteed to be accessible from any programming language that supports the CLS. Components that adhere to the CLS rules and use only the features included in the CLS are said to be CLS-compliant components.

Most of the members defined by types in the .NET Framework Class Library are CLS-compliant. However, some types in the class library have one or more members that are not CLS-compliant. These members enable support for language features that are not in the CLS. The types and members that are not CLS-compliant are identified as such in the reference documentation, and in all cases a CLS-compliant alternative is available. For more information about the types in the .NET Framework class library, see the .NET Framework Class Library.

The CLS was designed to be large enough to include the language constructs that are commonly needed by developers, yet small enough that most languages are able to support it. In addition, any language construct that makes it impossible to rapidly verify the type safety of code was excluded from the CLS so that all CLS-compliant languages can produce verifiable code if they choose to do so. For more information about verification of type safety, see Managed Execution Process.

The following table summarizes the features that are in the CLS and indicates whether the feature applies to both developers and compilers (All) or only compilers. It is intended to be informative, but not comprehensive. For details, see the specification for the Common Language Infrastructure, Partition I, which is available on the Microsoft Developer Network (MSDN) Web site.

Monday, June 14, 2010

thumbnail

What is Metadata?

Metadata is binary information describing your program that is stored either in a common language runtime portable executable (PE) file or in memory. When you compile your code into a PE file, metadata is inserted into one portion of the file, while your code is converted to Microsoft intermediate language (MSIL) and inserted into another portion of the file. Every type and member defined and referenced in a module or assembly is described within metadata. When code is executed, the runtime loads metadata into memory and references it to discover information about your code's classes, members, inheritance, and so on.

* What does Metadata do?

Metadata describes every type and member defined in your code in a language-neutral manner. Metadata stores the following information:

o Description of the assembly.

+ Identity (name, version, culture, public key).
+ The types that are exported.
+ Other assemblies that this assembly depends on.
+ Security permissions needed to run.


o Description of types.

+ Name, visibility, base class, and interfaces implemented.
+ Members (methods, fields, properties, events, nested types).


o Attributes

+ Additional descriptive elements that modify types and members.



* What are the benefits of Metadata?

Metadata is the key to a simpler programming model, eliminating the need for Interface Definition Language (IDL) files, header files, or any external method of component reference. Metadata allows .NET languages to describe themselves automatically in a language-neutral manner, unseen by both the developer and the user. Additionally, metadata is extensible through the use of attributes. Metadata provides the following major benefits:

o Self-describing files

Common language runtime modules and assemblies are self-describing. A module's metadata contains everything needed to interact with another module. Metadata automatically provides the functionality of IDL in COM, allowing you to use one file for both definition and implementation. Runtime modules and assemblies do not even require registration with the operating system. As a result, the descriptions used by the runtime always reflect the actual code in your compiled file, which increases application reliability.


o Language Interoperability and easier component-based design

Metadata provides all the information required about compiled code for you to inherit a class from a PE file written in a different language. You can create an instance of any class written in any managed language (any language that targets the common language runtime) without worrying about explicit marshaling or using custom interoperability code.


o Attributes

The .NET Framework allows you to declare specific kinds of metadata, called attributes, in your compiled file. Attributes can be found throughout the .NET Framework and are used to control in more detail how your program behaves at run time. Additionally, you can emit your own custom metadata into .NET Framework files through user-defined custom attributes. For more information, see Extending Metadata Using Attributes.

Monday, May 24, 2010

thumbnail

Implementing a Database Factory Pattern in C# ASP .NET

Why Do I Need a Database Layer Anyway?

When creating software for clients, even the beginner developer recognizes the frequency of change. Requirements change, user interface pieces change, platforms change, and databases changes. Determining ways to minimize re-work in your web applications becomes a very important task and by adding a distinct database layer to your C# ASP .NET application, you can greatly increase its flexibility and adaptability to change.

In addition to adaptability, a database layer can also provide an on-the-fly means of changing connections strings and even the database type itself. By changing just a few lines in your C# ASP .NET web.config file, you can effectively change the type of database accessed by your application from MSSQL to Oracle to MySQL - all without a single change to the application code.

The Simple Method

Many developers begin by coding the user interface of a web application, as this helps move the project visually. Because of this, it's not surprising that database code for populating the fields is often mixed directly in. In a C# ASP .NET application, this is similar to adding calls to SQLConnection in your Page_Load() function, as shown below.

using System.Data.SqlClient;

protected void Page_Load(object sender, EventArgs e)
{
using (SqlConnection MyConnection = new SqlConnection(MyConnectionString))
{
using (SqlCommand MyCommand = new SqlCommand("SELECT * FROM Flowers", MyConnection))
{
using (SqlDataReader MyReader = MyCommand.ExecuteReader())
{
// read flowers and process ...
}
}
}

}

Notice in the above code, we're referencing System.Data.SqlClient directly in the user interface code. We're also making calls to the database. A program will run just fine with this method. However, managing this code becomes a problem.

The core problem with the above code is not only that business logic may be mixed in with the user interface code (business logic would appear inside the "read database information" section), but that including database accessibility logic complicates the readability of the program. Furthermore, what happens when you need to change from using the SqlClient to using ODBC? You could change the "using" statement and rename the lines from SqlConnection to OdbcConnection throughout your code, but this may waste time and is also prone to errors.

A much more clear picture of this application could be made by leaving only user interface code inside the Page_Load() function. Defer the decision on what type of database to use and instead concentrate on user interface code. Any calls to database routines would be handled by a call to a separate layer, as follows:

using MyStuff.Managers;

protected void Page_Load(object sender, EventArgs e)
{
Flowers = CommonManager.GetFlowers();
}

Notice in the above code, the database functionality has been minimized to just a single line. The details of the database logic are abstracted away in a database layer. This greatly simplifies reading and managing the code. Now that you can see the initial benefits to utilizing a database layer in your C# ASP .NET web application, let's move on to implementing it.

Putting the Web.Config to Good Use

Before defining the actual database factory classes, we can use the C# ASP .NET web application's web.config file to hold some important data about how our database factory will be used. We will be storing information such as the type of database provider (MSSQL, Oracle, MySQL), a list of possible connection strings, as well as which connection string to use. By storing this information in the web.config file, we provide the flexibility to change the database provider or connection string in real-time, without changing code in the application.

Our web.config file will look similar to the following:
















In the above web.config file, we have two connection strings defined. One is for an Oracle database and another for an MSSQL database. You could have any number of connection strings. Our database factory design uses its own web.config section, defined in DatabaseFactoryConfiguration. This allows us to tell the database factory which provider class to instantiate (Oracle, MSSQL, etc) and which connection string to use. You can see the flexibility this adds, by allowing us to change any of these parts right in the web.config file.

The DatabaseFactory Web.Config Handler

Since we've added our own custom section to the web.config file for the database factory, we need to create a web.config custom section handler. The section handler is defined as follows:

using System.Configuration;

public sealed class DatabaseFactorySectionHandler : ConfigurationSection
{
[ConfigurationProperty("Name")]
public string Name
{
get { return (string)base["Name"]; }
}

[ConfigurationProperty("ConnectionStringName")]
public string ConnectionStringName
{
get { return (string)base["ConnectionStringName"]; }
}

public string ConnectionString
{
get
{
try
{
return ConfigurationManager.ConnectionStrings[ConnectionStringName].ConnectionString;
}
catch (Exception excep)
{
throw new Exception("Connection string " + ConnectionStringName + " was not found in web.config. " + excep.Message);
}
}
}
}

The only important part to note about the section handler is that it derives from the ConfigurationSection base class. When this class is instantiated, it will automatically read the line from the web.config file and populate with the values. Since we include a ConnectionString property, it will also fetch the correct connection string, so that we never have to access the ConfigurationManager.ConnectionStrings property ourselves.

It All Starts With a Database

The first part to creating a database factory design pattern is to implement your generic Database object. This is the object you will reference when calling database routines. Since this object is generic, you don't have to decide what type of physical database to actually use with it. This gives you the power to change database providers without changing any of your code. The database object is designed as follows:

using System.Data;

public abstract class Database
{
public string connectionString;

#region Abstract Functions

public abstract IDbConnection CreateConnection();
public abstract IDbCommand CreateCommand();
public abstract IDbConnection CreateOpenConnection();
public abstract IDbCommand CreateCommand(string commandText, IDbConnection connection);
public abstract IDbCommand CreateStoredProcCommand(string procName, IDbConnection connection);
public abstract IDataParameter CreateParameter(string parameterName, object parameterValue);

#endregion
}

It's important to note that we're using .NET's own abstract database factory interfaces. The interfaces can be used in exactly the same way as the concrete database classes (SqlConnection, OdbcCommand, etc), without forcing you to bind to one. This is the core piece to providing flexibility to your database layer.

The Powerful Database Factory

With the details out of the way, we can move on to the power behind the database factory design pattern, which of course, is the factory class itself. The database factory is the class we will use to instantiate the concrete provider for our generic Database class. Remember, we defined an abstract Database class which we can use without deciding on a concrete database provider. Instead, we specify the concrete provider in the web.config and let the database factory design pattern instantiate it. Note, the database factory is able to instantiate any type of concrete database by using C# .NET reflection.

The database factory is defined as follows:

using System.Reflection;
using System.Configuration;

public sealed class DatabaseFactory
{
public static DatabaseFactorySectionHandler sectionHandler = (DatabaseFactorySectionHandler)ConfigurationManager.GetSection("DatabaseFactoryConfiguration");

private DatabaseFactory() { }

public static Database CreateDatabase()
{
// Verify a DatabaseFactoryConfiguration line exists in the web.config.
if (sectionHandler.Name.Length == 0)
{
throw new Exception("Database name not defined in DatabaseFactoryConfiguration section of web.config.");
}

try
{
// Find the class
Type database = Type.GetType(sectionHandler.Name);

// Get it's constructor
ConstructorInfo constructor = database.GetConstructor(new Type[] { });

// Invoke it's constructor, which returns an instance.
Database createdObject = (Database)constructor.Invoke(null);

// Initialize the connection string property for the database.
createdObject.connectionString = sectionHandler.ConnectionString;

// Pass back the instance as a Database
return createdObject;
}
catch (Exception excep)
{
throw new Exception("Error instantiating database " + sectionHandler.Name + ". " + excep.Message);
}
}
}

It's important to note the use of .NET Reflection in the database factory. While this adds the extensibility and power for our database layer, it also adds a bit of overhead to processing. This overhead can be minimized, as you'll see below, by utilizing a static variable so that the number of times objects are instantiated by the factory is minimized.

Putting the Database Factory to Use

We've now implemented the C# ASP .NET database factory design pattern, using the built-in .NET generic database interfaces. To actually use the database factory, we'll create a data worker class to take care of handling how the database factory and generic database are used.

Our data worker class holds a static instance of the abstract Database class. In its constructor, we instantiate the concrete database (defined in the C# ASP .NET web applicaion's web.config file) by using our database factory design pattern. The data worker is defined as follows:

public class DataWorker
{
private static Database _database = null;

static DataWorker()
{
try
{
_database = DatabaseFactory.CreateDatabase();
}
catch (Exception excep)
{
throw excep;
}
}

public static Database database
{
get { return _database; }
}
}

Notice how, in the above code, there are no references to concrete database providers. Nowhere do we reference MSSQL, Oracle, or other concrete types. Everything is kept generic by using the abstract Database class and leaving the details of the concrete type inside the web.config file for the factory to access.

Now, whenever we create a manager class to perform business logic related to the database, we simply inherit from DataWorker. This gives the class instant access to the database routines. For example, we can now create a manager class as follows:

class MyDatabaseLogic : DataWorker
{
public void LoadFlowers()
{
using (IDbConnection connection = database.CreateOpenConnection())
{
using (IDbCommand command = database.CreateCommand("SELECT * FROM FLOWERS", connection))
{
using (IDataReader reader = command.ExecuteReader())
{
// read flowers and process ...
}
}
}
}
}

How About a Concrete Database Class?

Up until this point, we've created abstract and generic classes which defer the decision on which database type to actually use. Now, it's time to create a concrete implementation of the abstract Database object. You will create a concrete Database class for the type of database you plan on using (or may use in the future). If you end up needing to change the database provider, you can change the web.config to use a different concrete implementation.

For this example, we'll define an Oracle Database class as follows:

using Oracle.DataAccess.Client;

public class OracleDatabase : Database
{
public override IDbConnection CreateConnection()
{
return new OracleConnection(connectionString);
}

public override IDbCommand CreateCommand()
{
return new OracleCommand();
}

public override IDbConnection CreateOpenConnection()
{
OracleConnection connection = (OracleConnection)CreateConnection();
connection.Open();

return connection;
}

public override IDbCommand CreateCommand(string commandText, IDbConnection connection)
{
OracleCommand command = (OracleCommand)CreateCommand();

command.CommandText = commandText;
command.Connection = (OracleConnection)connection;
command.CommandType = CommandType.Text;

return command;
}

public override IDbCommand CreateStoredProcCommand(string procName, IDbConnection connection)
{
OracleCommand command = (OracleCommand)CreateCommand();

command.CommandText = procName;
command.Connection = (OracleConnection)connection;
command.CommandType = CommandType.StoredProcedure;

return command;
}

public override IDataParameter CreateParameter(string parameterName, object parameterValue)
{
return new OracleParameter(parameterName, parameterValue);
}

As you can see in the above code, we fill out the body for each abstract function defined in the Database class. You can customize the abstract and concrete classes further to perform more functionality.

Putting It All Together

Now that our C# ASP .NET database layer is complete, we can use the layer to refactor our original "Simple" database access code listed above. An example is shown below which replaces our Page_Load() database code with usage of our Manager class (which, in turn, uses the Database and factory classes).

class FlowerManager : DataWorker
{
public static void GetFlowers()
{
using (IDbConnection connection = database.CreateOpenConnection())
{
using (IDbCommand command = database.CreateCommand("SELECT * FROM FLOWERS", connection))
{
using (IDataReader reader = command.ExecuteReader())
{
// ...
}
}
}
}
}

protected void Page_Load(object sender, EventArgs e)
{
Flowers = FlowerManager.GetFlowers();

// Populate the flowers in a C# ASP .NET droplist control.
MyDropListControl.DataSource = Flowers;
MyDropListControl.DataBind();
}

Sunday, May 9, 2010

thumbnail

What Are Design Patterns and Do I Need Them?

What Are Design Patterns and Do I Need Them?

Software professionals may be familiar with the term "Design Patterns," but many have no idea of where they come from and what they truly are. Consequently, some do not see the value and benefits design patterns bring to the software development process, especially in the areas of maintenance and code reuse. This article will bridge this gap by defining design patterns from a historical perspective. It will also summarize the salient features of a typical design pattern and arrive at a working definition so that you will know what they are and what to expect when you incorporate them into your designs. Finally, it will explicitly summarize the benefits design patterns bring to software development and why you should incorporate them into your work. Subsequent articles will present more detailed descriptions of some of the more common design patterns, and how they can be applied to software development on the .NET platform.

What Are Design Patterns and Where Do They Come From?

Design patterns are commonly defined as time-tested solutions to recurring design problems. The term refers to both the description of a solution that you can read, and an instance of that solution as used to solve a particular problem. (I like the analogy of comparing design patterns to a class and an object instance of the class. Each is a different way to represent a thing.) Design patterns have their roots in the work of Christopher Alexander, a civil engineer who wrote about his experience in solving design issues as they related to buildings and towns. It occurred to Alexander that certain design constructs, when used time and time again, lead to the desired effect. He documented and published the wisdom and experience he gained so that others could benefit. About 15 years ago, software professionals began to incorporate Alexander's principles into the creation of early design pattern documentation as a guide to novice developers. This early work led others to also write about design patterns and culminated in the publication of Design Patterns: Elements of Reusable Object-Oriented Software in 1995 by Eric Gamma, Richard Helm, Ralph Johnson, and John Vlissides. This book is considered to be the "coming out" of design patterns to the software community at large and has been influential in the evolution of design patterns since. Design Patterns described 23 patterns that were based on the experience of the authors at that time. These patterns were selected because they represented solutions to common problems in software development. Many more patterns have been documented and cataloged since the publishing of Design Patterns. However, these 23 are probably the best known and certainly the most popular.

Design patterns are represented as relationships between classes and objects with defined responsibilities that act in concert to carry out the solution. To illustrate a design pattern, consider the Adapter pattern, one of the original 23 patterns described in Design Patterns. Adapter provides a solution to the scenario in which a client and server need to interact with one another, but cannot because their interfaces are incompatible. To implement an Adapter, you create a custom class that honors the interface provided by the server and defines the server operations in terms the client expects. This is a much better solution than altering the client to match the interface of the server.

The design pattern community is growing both in membership and coverage. The pattern literature describes new patterns that solve emerging issues related to technical advancements. As a software professional, you are the beneficiary of this body of knowledge. To use these patterns, you will need to learn them and become familiar with them so you will know which pattern to pull from your toolbox when a design issue arises. Many patterns have been documented over the years. They have been classified in different ways by different authors. Take the time to learn different ways to classify design patterns because you will gain greater insight into them. As you learn more and more patterns, it would be a good idea to develop your own classification system; one reflecting the way you utilize them.

Structure of a Design Pattern

Design pattern documentation is highly structured. The patterns are documented from a template that identifies the information needed to understand the software problem and the solution in terms of the relationships between the classes and objects necessary to implement the solution. There is no uniform agreement within the design pattern community on how to describe a pattern template. Different authors prefer different styles for their pattern templates. Some authors prefer to be more expressive and less structured, while others prefer their pattern templates to be more precise and high grain in structure. We will use the template first described by the authors of Design Patterns to illustrate a template.

Term

Description

Pattern Name

Describes the essence of the pattern in a short, but expressive, name

Intent

Describes what the pattern does

Also Known As

List any synonyms for the pattern

Motivation

Provides an example of a problem and how the pattern solves that problem

Applicability

Lists the situations where the pattern is applicable

Structure

Set of diagrams of the classes and objects that depict the pattern

Participants

Describes the classes and objects that participate in the design pattern and their responsibilities

Collaborations

Describes how the participants collaborate to carry out their responsibilities

Consequences

Describes the forces that exist with the pattern and the benefits, trade-offs, and the variable that is isolated by the pattern

This template captures the essential information required to understand the essence of the problem and the structure of the solution. Many pattern templates have less structure than this, but basically cover the same content.

Benefits of Design Patterns

Design patterns have two major benefits. First, they provide you with a way to solve issues related to software development using a proven solution. The solution facilitates the development of highly cohesive modules with minimal coupling. They isolate the variability that may exist in the system requirements, making the overall system easier to understand and maintain. Second, design patterns make communication between designers more efficient. Software professionals can immediately picture the high-level design in their heads when they refer the name of the pattern used to solve a particular issue when discussing system design.

Friday, February 26, 2010

thumbnail

Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc

Another error of the day, When you try to create connection string from SQLDatasource or even want to bind existing connection string. You might see a Message box saying
Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
This error comes when you are trying to access SQL 2005 stuff from Visual Studio 2008

So go to the link and download the following stuff
•Microsoft SQL Server System CLR Types
•Microsoft SQL Server 2008 Management Objects
•Microsoft SQL Server 2008 Native Client

Tuesday, February 23, 2010

thumbnail

How to search all columns of all tables in a database for a keyword?

How to search all columns of all tables in a database for a keyword?

The output of this stored procedure contains two columns:

- 1) The table name and column name in which the search string was found
- 2) The actual content/value of the column (Only the first 3630 characters are displayed)

Here's a word of caution, before you go ahead and run this procedure. Though this procedure is quite quick on smaller databases, it could take hours to complete, on a large database with too many character columns and a huge number of rows. So, if you are trying to run it on a large database, be prepared to wait (I did use the locking hint NOLOCK to reduce any locking). It is efficient to use Full-Text search feature for free text searching, but it doesn't make sense for this type of ad-hoc requirements.

Create this procedure in the required database and here is how you run it:

--To search all columns of all tables in database for the keyword "Hello"
EXEC SearchAllTables 'Computer'
GO

Store procedure code

CREATE PROC SearchAllTables
(
@SearchStr nvarchar(100)
)
AS
BEGIN
CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))

SET NOCOUNT ON

DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')

WHILE @TableName IS NOT NULL
BEGIN
SET @ColumnName = ''
SET @TableName =
(
SELECT MIN(QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME))
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
AND QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME) > @TableName
AND OBJECTPROPERTY(
OBJECT_ID(
QUOTENAME(TABLE_SCHEMA) + '.' + QUOTENAME(TABLE_NAME)
), 'IsMSShipped'
) = 0
)

WHILE (@TableName IS NOT NULL) AND (@ColumnName IS NOT NULL)
BEGIN
SET @ColumnName =
(
SELECT MIN(QUOTENAME(COLUMN_NAME))
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = PARSENAME(@TableName, 2)
AND TABLE_NAME = PARSENAME(@TableName, 1)
AND DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
AND QUOTENAME(COLUMN_NAME) > @ColumnName
)

IF @ColumnName IS NOT NULL
BEGIN
INSERT INTO #Results
EXEC
(
'SELECT ''' + @TableName + '.' + @ColumnName + ''', LEFT(' + @ColumnName + ', 3630)
FROM ' + @TableName + ' (NOLOCK) ' +
' WHERE ' + @ColumnName + ' LIKE ' + @SearchStr2
)
END
END
END

SELECT ColumnName, ColumnValue FROM #Results
END

Saturday, February 20, 2010

thumbnail

Search Engine Optimization

After navigating few sites and going through Aaron Matthew Wall’s book on SEO ‘SEO BOOK’ I learned few things about SEO.

Note: Google is targeted mainly in this article.

Parts of Search Engine:Every crawling search engine has the same basic parts

• a crawler
• an index (or catalog)
• search interface

Crawler:
It scours the web following links, updating pages, and adding new pages when it comes across them. Search engines have time of deep crawling and shallow crawling.

Note: We can get page crawled frequently if we get already frequently crawling page point to our page through a hyperlink.


Index:
The index is where the spider collected data is stored.

Example: When you search Google and it displays 1-10 out of 143,000 website it means that there are 143,000 web pages which either have the words in your keyword phrase on them, or have inbound links containing the words in the phrase.

Note: To see which pages of a site are indexed by google type
site:www.sitename.com

Search Interface:
The search algorithm and search interface are used to find the most relevant document in the index based on the user search.

Note: In most major search engines a portion of the relevancy calculations are stored ahead of time and some of them are calculated in real time.




Factors and Guidelines Influencing Page Ranking:
http://en.wikipedia.org/wiki/Search_engine_optimization + Google Guidelines + SEO BOOK

SEOs widely agree that the signals that influence a page's rankings include

1. Use keywords in the title tag.
2. Use appropriate domain name.
Tips:
a. Avoid long domain names
b. Avoid dashes in domain names. E.g. googleads.com is better than
google-ads.com
c. If site is hosted in UK then use .co.uk domain. Also buy the .com version of domain and redirect to .co.uk.
d. If possible use domain name with keywords in it.
e. Register your domain at ICANN accredited registrar.
f. Don’t go for free hosting.
g. Try hosting the site in country it targets e.g. host googleads.co.uk in United Kingdom.
Note: Dreamhost and Pair are recommended sites by SEO BOOK for hosting

3. Use keywords in links pointing to the page.
4. Use keywords appearing in visible text.
5. Keywords in Heading Tag H1, H2 and H3 Tags in webpage.
6. Use proper linking from one page to inner pages.
7. Try placing punch line at the top of page.
8. Have other relevant sites link to yours.
Note: This is most important and time consuming in SEO. For more details see Creating Inbound Links
9. Make sure all the sites that should know about your pages are aware your site is online.
10. Make a site with a clear hierarchy and text links. Every page should be reachable from at least one static text link.
11. Offer a site map to your users with links that point to the important parts of your site. If the site map is larger than 100 or so links, you may want to break the site map into separate pages.
12. Think about the words users would type to find your pages, and make sure that your site actually includes those words within it.
13. Try to use text instead of images to display important names, content, or links. The Google crawler doesn't recognize text contained in images.
14. Make sure that your TITLE and ALT tags are descriptive and accurate.
15. Check for broken links and correct HTML. Xenu Link Sluth is a free downloadable link checking program.
16. If you decide to use dynamic pages (i.e., the URL contains a "?" character), be aware that not every search engine spider crawls dynamic pages as well as static pages. It helps to keep the parameters short and the number of them few.
17. Keep the links on a given page to a reasonable number (fewer than 100).

There are many other signals that may affect a page's ranking, indicated in a number of patents held by various search engines, such as historical data. For more details see the
Nitty-Gritty section.

Note: Google, Yahoo, Microsoft and Ask.com do not disclose the algorithms they use to rank pages.


Getting Page in Search Engine Database:
http://en.wikipedia.org/wiki/Search_engine_optimization

• You can use Google’s AddUrl
• You can use Google Sitemaps and create and XML feed of sitemap to be submitted.
• A link to your page from already indexed site. (It can take a few days or even weeks from the acquisition of a link from such a site for all the main search engine spiders to begin indexing a new site, and there is usually not much that can be done to speed up this process). This is the best and recommended way.
• Using paid submission services. (Such services usually guarantee inclusion in the database, but does not guarantee specific ranking within the search results).

Note: Major search engines, by and large, do not require any extra effort to submit to, as they are capable of finding pages via links on other sites.


Blocking Page from Entering in Search Engine Database:http://en.wikipedia.org/wiki/Search_engine_optimization

Webmasters can instruct spiders not to crawl certain files or directories through the standard robots.txt file in the root directory of the domain. Additionally, a page can be explicitly excluded from a search engine's database by using a robots Meta tag.

Example:


Note: You can learn more about Robot.txt file by clicking here

Getting Inbound Links / Back LinksAn inbound links are ‘hyperlinks transiting domains’ or you can say simply ‘links into a page’ e.g. link from page A to page B will be an inbound link for page B. Search engines usually count this a vote to page B from page A


Who links to you and with what words is the #1 ranking criteria for competitive phrases in all major search engines

Note:
• To check backlinks to a site in google type
link:www.sitename.com
• To check backlinks to a site in Yahoo type
linkdomain:www.sitename.com
Tools:
• Digital Point [Look here for free tool which will track your Google position by keyword, PageRank, and number of backlinks]
• Rusty Brick [Tool that does Google backlink analysis]


Getting inbound links is most difficult and time consuming part of SEO. For this
1. You can submit your site to directories. Click here for list of directories.
o Writing articles about your topic and placing them on other websites can give you inbound links via the article signature. Click here for list of sites where you can submit your articles
2. Writing press releases can give you inbound links. You can submit a press release at
o PRWEB
o 24 7 Press Release
o Click 2 NEWS
o Free News Release
o Free Press Release
o I Newswire
o Media Syndicate
o PR Free
o PR Leap
o PR Web
o Web Wire
3. People interested in your site may eventually link to you without you asking.
4. You can participate in forums which provide signature links.
5. A somewhat recent move which has been exploited is posting comments directed toward your website in web logs.
6. Sponsor 501C organizations.
7. Place advertisements on relevant related sites.
8. Make some thing useful e.g. some software [if you are running software oriented site] and give it for free to download.
9. You can email the person at support. Consider sample email.
Sample Email:
hello
I have been browsing around photography sites for hours now and just ran across yours...its awesome (stroke the ego)
wow your picture of that dove, bla bla bla...bird photography is one of my bla bla bla (be specific & show you visited their site)
I took this pic or a flying mongoose here: (look we are the same)
I have already added a link to your site on my cool sites page
(/ If you feel a phone call is necessary then you may want to give them your number or call them up versus send an email.)
Your site visitors may well be interested in bla bla bla at my site bla bla (show them how linking to you benefits them)
If you like my site please consider linking to it however you like (let them know they have choices - don't come across as ordering them to do something)
Or with this code (make it easy for them)
I think my site matches well with the theme on this page
Either way thanks for reading this and keep posting the awesome photos (reminder ego stroke)

Thanks

Me
Me at
myemail.com
http://www.mywhateversite.com
my number


• The people who are subscribing to RSS feeds are also the most likely to be people who comment on the contents of the sites you want your page link on. If you can figure out a way to get these people to desire to give you their attention you quickly and cheaply reach the most influential voices.
Note:
1. Never ever link your site to Viagra, casino, drug, gambling and porn sites or other high margin off topic websites. In such case you may end up getting your site banned.
2. Don’t link to site that does not offer quality content.
3. Try not to link to sites on same hosted server and don’t try to create your own sites for linking purpose.

Tools for Inbound Links
• Hub Finder [tool looks for co occurring back links]
• Prog [Google PageRank display search tool]
• Rusty Brick’s [link analysis tool. Works with the Google API and offers C block IP and anchor text reporting. Since it works with the Google API it is somewhat slow, but it is free]
• Class C IP checker [checks for duplicate class C IP addresses from a list of domains. Links from sites which are on the same C block IP address may not carry as much weight as sites from different C block IP addresses.]
• PostTrades unique C block backlink checker [In the upper right corner of the PostTrades website is a tool which will tell you the number of unique C block IP addresses pointing links into your site. Tool works by looking that the IPs in the first 1000 backlinks in Yahoo!. If you have over 1000 backlinks then the tool may not provide accurate results]
• Unique Linking Domain Checker [returns links to all unique linking websites that link at your site]
• Unique C Block Backlinks Checker [allows you to quickly survey how competitive a market is by seeing how many C blocks are linking at competing websites]
• Optilink link analysis software [Optilink automates sorting competitotrs backlinks and displays the anchor text in links]
• SEO Elite [similar to Optilink, but also checks reciprocal link partners. Brad has been doing a good job of updating it and adding features to it. If you are torn between OptiLink and SEO Elite I would recommend buying SEO Elite, or trying them both and returning whichever one you do not like]
• PRWeb [free press releases. I often recommend purchasing one of their premium services though]
• Cooperative Ad Network [this essentially amounts to a huge link farm, but it is blended in with many sites that are well integrated into the web. Eventually it may somehow be filtered out or lessened in power, but currently it is rather powerful for MSN and Yahoo! (and to a lesser extent Google). I currently am not using this ad network on any of my permanent sites, but feel it is worth mentioning]
• LinkItForward [LinkItForward is similar to the Coop Ad Network in that it uses the power of many sites to help them all. Instead of reciprocating links with LinkItForward you link to some domains and for doing that get credits where others will link to your domain. I currently am not using LinkItForward on any of my sites, but feel it is worth mentioning]
• LinkExplore [LinkExplore helps you collect contact and linking details to trade links with people who have site details in the LinkExplore database. The LinkExplore database has over 10,000 entries and you can search by keyword and category. LinkExplore also allows you to collect data from the search engines similarly to how SEO Elite and OptiLink work. One of the benefits of LinkExplore over some of the other link analysis tools is that their database already has a number of people in it who are likely to want to trade links with similar related resources.]
• Arelis [link exchange software. It allows you to seek out link partners, their contact information, and email them. I would make sure I customized any email I sent out so as to avoid being accused of email spamming. Arelis also tracks your status with link exchange communications. Arelis also allows you to upload HTML pages with your link partners links on them, but I would not recommend using that feature on permanent sites, or ensure I removed any footprints left by software which is designed specifically for link exchanges. It lets you chose the base template to match your site, but you will want to make sure the coding matches up well also. When you exchange links it is a good idea to also link to related internal pages and quality resources that may not be linking back at your site. ()]
• Zeus [Zeus is a link exchange manager / directory software similar to Arelis. Both offer a free trial. I have not fully tested Zeus]
Keywords
Definition:
Keywords are typically two to five word phrases you expect people to search for to find your website.
Note:
• A note of caution is that you can not optimize a page for 20 different keywords. As you add more keywords to the mix, you lessen the keyword density and change the focus of the page. The page can start to sound robot created if you are optimized for too many terms.
• Avoid misspellings in keywords
• Most search engines treat hyphens as a space. E-mail is different than email. If a word is split in half by a hyphen then you should check to see which version is used more frequently and optimize for whatever versions are commonly searched for. If a hyphen is sometimes placed between two words then using either version (with or without a hyphen) will cause your page to rank better for both versions.
Finding Keywords:
• Words people would search for to find your product
• Problems your prospective customers may be trying to solve with your product or service (even if they do not know you exist)
• Keyword tags on competitors websites
• Visible page copy on competitors websites
• Related search suggestions on top search engines (such as Google or Yahoo!)
• Related term suggestion at smaller engines such as Gigablast and Vivisimo
• Keyword groupings via tools such as Google Sets
• Keyword suggestion tools (which are covered in the next section)

Tools:
Below is a list of tools, some generate keywords and some help in keyword generation process. Some also tell your ranking on Yahoo and Google for keywords.
• Overture Search Term Suggestion Tool [Free tool based on prior months Overture ad distribution. Please note the Overture tool combines singular and plural versions of a word and only can track those terms which already have ads in place. Since Overture makes money by selling ads and many automated bots search through their distribution network their results may run high (some highly competitive commercial terms are off by a factor greater than 10 fold).]
• DaveN Scrapper Tool [It queries Google Suggest]
• Google Suggest [Near the end of 2004 Google launched Google Suggest, which attempts to auto-complete search queries. The results are influenced by search popularity so you can use the tool to help you find many of your deeper keyword phrases after you find some of your broad keywords.]

• Google Keyword Sandbox [Free tool from Google AdWords. Offers likely synonyms to the word you type in, but does not approximate traffic. To approximate traffic you would need to set up a Google AdWords campaign and track the number of times your ad displays. Be careful in doing this because it can get rather expensive if you create random ads for the wrong words and / or bid highly for your keywords.]
• Google Sets [Shows groups of related keywords]
• Good Keywords [Good Keywords is free and offers some useful features. it saves you keyword searches and can be well worth the free download for doing preliminary keyword research.]
• The Google Toolbar [Good for highlighting keyword density and doing many things like giving you a quick glimpse of a cached copy of a page and its back links.
• WordTracker [WordTracker takes sampled data from a couple Meta search engines and projects future search rates for different words.]
• Keyword Discovery [Keyword Discovery is a similar product to WordTracker with a few more features and a deeper database]
• Ontology Tool [Finds related words using the Google ~ search.]
• Lexical Database Wordnet [a lexical keyword database for the English language.]
• Digital Point [Digital Point created a free tool which combines the Overture tool and the free version WordTracker tool.]
• Post Trades [Post Trades is a new SEO forum which has a free tool in the upper right corner which tells you how many unique linking domains are pointing links into a site. That tool will not tell you whether or not they are using keyword rich anchor text, but it is another good way to estimate how competitive a keyword is. The Post Trades tool only analyzes the first 1,000 backlinks in Yahoo!, so if your competitors have more than 1,000 backlinks it may not be accurate.]
• Yahoo! Search Rankings [Yahoo! Search Rankings is a way to quickly check where your site ranks for any given term in Yahoo!]
• Yahoo! Tracker [Tracks keyword rankings in Yahoo!]
• Top25Web Page Rank lookup [shows PageRank of any page you input]
Misc Article Submission Sites:• http://goarticles.com/
• http://ezinearticles.com/add_url.html
• http://amazines.com
• http://www.articlecity.com/
• http://bpubs.com/
• http://businessknowhow.com/
• http://www.certificate.net/wwio/ideas.shtml
• http://www.promotionworld.com/
• http://promotenewz.com/
• http://www.purplepages.ie
• http://www.stickysauce.com
• http://www.certificate.net
• http://www.freesticky.com
• http://www.bullmarketer.com
• Many more

Yahoo Announcement Groups• http://groups.yahoo.com/group/ArticlePublisher/
• http://groups.yahoo.com/group/Free_eContent/
• http://groups.yahoo.com/group/Free-Reprint-Articles/
• http://groups.yahoo.com/group/FreeWrites/
• http://groups.yahoo.com/group/freE-zinecontent/
• http://groups.yahoo.com/group/netwrite-publish-announce/
• http://groups.yahoo.com/group/publisher_network/
• http://groups.yahoo.com/group/ReprintArticles-Paradise/
• http://groups.yahoo.com/group/TheWriteArticles
• http://groups.yahoo.com/group/aainet/
• http://groups.yahoo.com/group/Free-Content/
• http://groups.yahoo.com/group/aabusiness/

More Article Submission Sites:• For more article submission sites click on Microsoft Excel Worksheet below

Saturday, January 23, 2010

thumbnail

Debug Your ASP.NET Application that Hosted on IIS : Process Attach and Identify which process to attach



Overview  



Generally we debug our Asp.Net web application from Visual Studio. Visual Studio
having it own ASP.Net engine which is capable enough to run and debug your web sites
inside visual studio. But If your site is hosted on IIS and you want to debug that
site, how will you debug it? When we hosted sites on IIS, worker process(w3wp.exe)
is used to run the web application. We need to attach the particular process in
Visual Studio to debug the application. This article describes the overall idea
of debugging an application with process attached. It also describe about worker
process
, application pool and selecting particular process
if there are multiple worker process running on IIS using iisapp.vbs
.  Hope you will enjoy this article and provide your valuable suggestion and
feedback.



ASP.NET Debugging VS IIS Debugging



Visual studio is having its own integrated debugging engine which debugs our code
when we run the application from Visual Studio. If we are developing a sites and 
need to debug the code, we just set the Breakpoints and do the debugging. [Note
: In this article I am not describing how to set the debug mode]. When we run the
application, code breaks when certain break point comes in. It is very simple because
when a ASP.NET application is running from the Visual studio it is under control
of the Asp.Net Engine which is integrated with Visual Studio. 
If  you want to check which process is running for debugging, run the web application
from Visual Studio, you will get a popup notification like below



debugg1.jpg



Fig: Showing Popup when debugging is start from Visual Studio



which indicates a process is starting for run the ASP.NET application . Double Click
on the Icon. A popup window will come and will show the details.



debugg2.jpg



Fig: Development Server Process Details



and behind the running process  is "WebDev.WebServer.Exe" . When
We Press F5 to run, this process starts to execute the Asp.Net Application.
if you want run the application from command prompt you have to perform the following
steps.



Steps :



  1. Open The Visual Studio Command Prompt

  2. Run Webdev.WebServer



Following screen will come. Check out the Example Section.



debugg3.jpg



Fig : Webdev.WebServer 



Now back to the IIS Debugging. IIS comes into the picture when we deployed
or Host the Site. After deploying the sites on IIS if we want to debug the site
from, we can't do it directly as in Visual studio. IIS having its own worker process
who takes care of all the execution and maintenance of deployed web application.
I have described the details of worker process in later section. So if we have running
process in IIS and we need to the application, first of all we have to attach the
correct process in Visual Studio. Before going to check that how to attach process
just have a look on worker process and Application Pool.



What is Worker Process?



Worker Process (w3wp.exe) runs the ASP.Net application in IIS. All
the ASP.Net functionality runs under the scope of worker process.  When a request
comes to the server from a client worker process is responsible to generates the
request and response. Its also maintain the InProc session data. If we recycle the
worker process we will lost the state of worker process.  For more information
read this article
A low-level Look at the ASP.NET Architecture



Application Pool: 



This is one of the most important thing that you should create for your own application
in Production environment. Application pools used to separate sets of IIS worker
processes
that share the same configuration. Application pools enable
us to isolate our web application for better security, reliability, and availability.
The worker process serves as the process boundary that separates each application
pool so that when one worker process or application is having an issue or recycles,
other applications or worker processes are not affected.





Default Application Pool



Name of the default application of IIS 6.0 is "DefaultAppPool" . After
hosting the site on IIS, if we check the properties of Virtual directory we can
able to view that.



  1. Start - Run - Inetmgr

  2. Expand the "DefaultWebSites" or Other Web Sites, where you have created
    the Virtual Directory

  3. Right Click on the Virtual Directory

  4. Click on Properties



Following screen will come, Now virtual Directory properties showing the application
pool name which is assigned to the selected site.



debugg4.jpg



If you want to check all the list of application pool IIS have to expand the Application
Pool Node on IIS Server.



debugg5.jpg



Fig: Default Application Pool



Now, each and every Application pool should have minimum one worker process
which takes care of the operation of the site which is associated with the application
pool.  Right Click on the Application Pool - Goto  performance
tab
, check at the below of the tab, there is a web garden  section.
and By default worker process is 1.
An application pool containing more than one worker process called Web Garden.



debugg6.jpg



Creating and Assigning Application Pool 



Open IIS Console, Right Click on Application Pool Folder > Create New





Give the Application Pool ID and Click Ok.





Now, Right Click on the Virtual Directory  and assign the newly created application
to that Virtual Directory.





So, this Web sites  will run independently with StateServerAppPool.
So any problem related with other application does not affects your Application.
This is the main advantages of creating application pool separately.



How to start?



Till now what ever I have told, that already give you a good idea on worker process
and Application Poll. And you should be cleared on thing before start the next part.
Now I will show you how to debug a site which is hosted on IIS Server.



I have created one web sites called sampleWebSite and hosted it on
to my local IIS. Bellow is default page output.





debugg9.jpg



Fig: Sample web site





Which Process to attach?



Now As I have already discussed the process name is w3wp.exe, so we
can check it from our Task Manager that whether the Worker Process
is running or not



debugg11.jpg



Fig: Task Manager showing the running process



Now we are going to attach the process. Goto Debug > Attach to
Process



debugg10.jpg



Fig: Open the Process attach window



After click Attach to Process, Following Screen will come,



debugg12_11.jpg



Fig : Single Worker process is running



Now we can able to view that same worker process is running. And we need to Attach
that Process. Select the Process and Click on the Attach Button. After the check
the below two images,



debugg7.gif



debugg8.gif



Fig:  1 ) Process Attached Successfully 2)
Process is not attached





Did you noticed the break point symbol? 
If the Worker process attached successfully with code break point symbol should
be clear other wise it should have some warning icon. For a Single worker process
the scenario is not common. But when we have multiple worker process running on
IIS then we can have some confusion. I will discuss the same in later section.



Now if we click the debug button the web page,  code will stop
at breakpoint.



Now have a look, If we are having multiple worker process running



How to Attach a Particular worker process when multiple is running 
?



Now, when this scenario will come? If we are having the multiple site hosted on
IIS and those sites are having there own application pool. Now multiple application
pool means multiple worker process is running .



Now I am having 3 Application pool in my IIS and those are,





  • Default Application Pool





  • Generic Application Pool





  • State Server Application Pool





Now, my SampleWebSite is associated  defaultAppPool.
and now I want to attach the process for debug my SampleWebSite. Do the same step
for open Process Attach windows



debugg9_1.gif



 Fig: List of Worker Process



Just have a look, there worker process is currently running and you have to attach
one of them but you do not know which Worker process is for default Application
pool. What  you did, you have select any one of them let say ID = class="code-digit">4308 and suppose it is not the worker process
for default application pool . So what will happen if you attach a wrong process?
Check the below image,



debugg10.gif



Fig: Process is not attach correctly 



Getting List of Running Worker Process



Now what is the solution for that. Here is an quick tips. 





  • Start > Run > Cmd





  • Go To Windows > System32 





  • Run cscript iisapp.vbs





and wait for the ouput. WoW



You will get the list of Running Worker Process , PID
and the Application Pool Name.



debugg13.jpg



Fig: List of running worker process with PID and Application Pool
Name



Attach Correct Process



From here you can easily identify the application pool name and there process Id.
Now again back to VS > Attach Process
. Now you know the process Id for Default application pool is
1772
, So Attach the process.



debugg14_1.jpg



Fig: Attach the process for debug 



Now, enjoy the debugging



debugg15.jpg



Fig: Break point is ready



 



Summary



Some times we need to debug our application which is hosted on IIS, for that we
need to attach the running worker process with the Visual Studio code. If we have
multiple worker process running on IIS server we can identify the proper worker
process by using cscript iisapp.vbs command. Hope this will help the beginners who
are struggling with debugging the application that are hosted on IIS. Please give
your feedback and suggestions to improve the article. Thank you.



style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px;
padding-top: 0px">

About me

simple one.