Monday, January 31, 2011

What is UDDI?

What is UDDI?

UDDI is a directory service where companies can register and search for Web services.
  • UDDI stands for Universal Description, Discovery and Integration
  • UDDI is a directory for storing information about web services
  • UDDI is a directory of web service interfaces described by WSDL
  • UDDI communicates via SOAP
  • UDDI is built into the Microsoft .NET platform

What is WSDL?

What is WSDL?

WSDL is an XML-based language for locating and describing Web services.
  • WSDL stands for Web Services Description Language
  • WSDL is based on XML
  • WSDL is used to describe Web services
  • WSDL is used to locate Web services
  • WSDL is a W3C standard

What is SOAP?


What is SOAP?

SOAP is an XML-based protocol to let applications exchange information over HTTP.
Or more simple: SOAP is a protocol for accessing a Web Service.
  • SOAP stands for Simple Object Access Protocol
  • SOAP is a communication protocol
  • SOAP is a format for sending messages
  • SOAP is designed to communicate via Internet
  • SOAP is platform independent
  • SOAP is language independent
  • SOAP is based on XML
  • SOAP is simple and extensible
  • SOAP allows you to get around firewalls
  • SOAP is a W3C standard

how to delete duplicate rows in Microsoft Sql Server

SELECT DISTINCT *
      INTO duplicate_TestDup
     FROM original_TestDup
      GROUP BY ID
      HAVING COUNT(ID) > 1
 
DELETE original_TestDup
      WHERE ID
      IN (SELECT ID
             FROM duplicate_TestDup
          )

INSERT original_TestDup
      SELECT *
         FROM duplicate_TestDup

DROP TABLE duplicate_TestDup

how to delete duplicate rows in oracle


create table testdup
(
id number(10) not null,
name varchar2(150) not null,
dept number(10) not null,
salary number(10) not null
)


insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
 insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
insert into testdup values(1,'Mukesh Kumar',12,11000);
 insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(2,'Nitin Kumar',13,21000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);
insert into testdup values(3,'Bipin Kumar',14,25000);


Select * from TestDup
output:

ID      Name            Dept    Salary
1    Naween Kumar    10    10000
2    Neeraj Kumar    11    15000
3    Nitin Kumar    12    21000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
1    Mukesh Kumar    12    11000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
2    Nitin Kumar    13    21000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000
3    Bipin Kumar    14    25000


DELETE FROM
           TestDup
WHERE
           ROWID IN
          (SELECT
                   ROWID
          FROM
                    (SELECT
                                ROW_NUMBER()
                     OVER (PARTITION BY id ORDER BY id) rnk
                         FROM
                     TestDup)
            WHERE
                   rnk>1
          );


output:

ID  Name                   Dept  Salary
1    Mukesh Kumar    12     11000
2    Nitin   Kumar       13    21000
3    Bipin Kumar        14     25000


               

Monday, January 24, 2011

Basic Differences between user controls and custom controls

What are the basic differences between user controls and custom controls?

Now that you have a basic idea of what user controls and custom controls are and how to create them, let's take a quick look at the differences between the two.

FactorsUser controlCustom control
DeploymentDesigned for single-application scenarios

Deployed in the source form (.ascx) along with the source code of the application

If the same control needs to be used in more than one application, it introduces redundancy and maintenance problems
Designed so that it can be used by more than one application

Deployed either in the application's Bin directory or in the global assembly cache

Distributed easily and without problems associated with redundancy and maintenance
CreationCreation is similar to the way Web Forms pages are created; well-suited for rapid application development (RAD)Writing involves lots of code because there is no designer support
ContentA much better choice when you need static content within a fixed layout, for example, when you make headers and footersMore suited for when an application requires dynamic content to be displayed; can be reused across an application, for example, for a data bound table control with dynamic rows
DesignWriting doesn't require much application designing because they are authored at design time and mostly contain static dataWriting from scratch requires a good understanding of the control's life cycle and the order in which events execute, which is normally taken care of in user controls

ASP.NET Integration Architecture

ASP.NET Integration Architecture

In IIS 6.0 and previous releases, ASP.NET was implemented as an IIS ISAPI extension.
In these earlier releases, IIS processed a request to an ASP.NET content type and then forwarded that request to the ASP.NET ISAPI DLL, which hosted the ASP.NET request pipeline and page framework. Requests to non-ASP.NET content, such as ASP pages or static files, were processed by IIS or other ISAPI extensions and were not visible to ASP.NET.
The major limitation of this model was that services provided by ASP.NET modules and custom ASP.NET application code were not available to non-ASP.NET requests. In addition, ASP.NET modules were unable to affect certain parts of the IIS request processing that occurred before and after the ASP.NET execution path.

Figure 1: IIS 6.0 & ASP.NET Pipelines
In IIS 7, the ASP.NET request-processing pipeline overlays the IIS pipeline directly, essentially providing a wrapper over it instead of plugging into it.
IIS 7 processes requests that arrive for any content type, with both native IIS modules and ASP.NET modules providing request processing in all stages. This enables services that are provided by ASP.NET modules, such as Forms authentication or output cache, to be used for requests to ASP pages, PHP pages, static files, and so on.
The ability to plug in directly into the server pipeline allows ASP.NET modules to replace, run before, or run after any IIS 7 functionality. This enables, for example, a custom ASP.NET Basic authentication module that is written to use the Membership service and SQL Server user database to replace the built-in IIS Basic authentication feature that works only with Windows accounts.
In addition, the expanded ASP.NET APIs use direct integration to enable more request-processing tasks. For example, ASP.NET modules can modify request headers before other components process the request, by inserting an Accept-Language header before ASP applications execute, which forces localized content to be sent back to the client based on user preference.

Figure 2: IIS 7 Integrated Mode
Because of the runtime integration, IIS 7 and ASP.NET can use the same configuration to enable and order server modules, and to configure handler mappings. Other unified functionality includes tracing, custom errors, and output caching.

Application Life Cycle

In Integrated mode, the ASP.NET request-processing stages that are exposed to modules are directly connected to the corresponding stages of the IIS 7 pipeline. The complete pipeline contains the following stages, which are exposed as HttpApplication events in ASP.NET:
  1. BeginRequest. The request processing starts.
  2. AuthenticateRequest. The request is authenticated. IIS 7 and ASP.NET authentication modules subscribe to this stage to perform authentication.
  3. PostAuthenticateRequest.
  4. AuthorizeRequest. The request is authorized. IIS 7 and ASP.NET authorization modules check whether the authenticated user has access to the resource requested.
  5. PostAuthorizeRequest.
  6. ResolveRequestCache. Cache modules check whether the response to this request exists in the cache, and return it instead of proceeding with the rest of the execution path. Both ASP.NET Output Cache and IIS 7 Output Cache features execute.
  7. PostResolveRequestCache.
  8. MapRequestHandler. This stage is internal in ASP.NET and is used to determine the request handler.
  9. PostMapRequestHandler.
  10. AcquireRequestState. The state necessary for the request execution is retrieved. ASP.NET Session State and Profile modules obtain their data.
  11. PostAcquireRequestState.
  12. PreExecuteRequestHandler. Any tasks before the execution of the handler are performed.
  13. ExecuteRequestHandler. The request handler executes. ASPX pages, ASP pages, CGI programs, and static files are served.
  14. PostExecuteRequestHandler
  15. ReleaseRequestState. The request state changes are saved, and the state is cleaned up here. ASP.NET Session State and Profile modules use this stage for cleanup.
  16. PostReleaseRequestState.
  17. UpdateRequestCache. The response is stored in the cache for future use. The ASP.NET Output Cache and IIS 7 Output Cache modules execute to save the response to their caches.
  18. PostUpdateRequestCache.
  19. LogRequest. This stage logs the results of the request, and is guaranteed to execute even if errors occur.
  20. PostLogRequest.
  21. EndRequest. This stage performs any final request cleanup, and is guaranteed to execute even if errors occur.
By using the familiar ASP.NET APIs, the ability to execute in the same stages as IIS 7 modules makes tasks that were only previously accessible in native ISAPI filters and extensions now possible in managed code.

Migrating the Application Configuration

Migrating the Application Configuration

IIS 7 migrates the application by using the AppCmd.exe command line tool to perform the migration. The migration error message contains the command that is executed in the command line window, which you must run with administrator user rights, to instantly migrate your application to Integrated mode.
The basic format of the migration command is as follows:
%windir%\system32\inetsrv\APPCMD.EXE migrate config Where is the virtual path of the application that contains the site name, such as "Default Web Site/app1".
When the migration is complete, your application will run in both Integrated and Classic modes without any problems.
Note: If you change the configuration after migration, the server will not prompt you to migrate again. After the initial migration, you must make sure that your configuration remains in sync between the two modes. You can manually migrate the application again by using the AppCmd.exe command line tool.