Blog Home  Home Feed your aggregator (RSS 2.0)  
Software Code Help
Blog
 
# Friday, January 22, 2010

At times users access a resource as though they were someone else. This is known as impersonation. For example, if a web page has no access controls, then any user can access that web page. HTML pages, ASP pages, and components in version 3.0 and earlier can be accessed through two accounts named IUSR_machinename and IWAM_machinename. Both the accounts are set up during IIS installation, and are automatically added to all the folders in every web site on the server.

Anonymous access to a resource in IIS makes the task of identifying a user extremely difficult. But there is no need to authenticate a user in the case of IIS. When IIS receives a request for a web page or other resource that has permission for anonymous access, IIS treats the IUSR_machinename account as the user's account, to access the resources. If the resource requested by the user is an ASP page that uses a COM or COM+ component, that component is executed using the IWAM_machinename account.

In ASP.NET, when impersonation is turned off, the resources can be accessed using a "local system process" account. When impersonation is turned on, ASP.NET executes every resource using the account of a specified user who is authenticated when the user makes the request. If you specify the IUSR_machinename account to be used as the user account, then ASP.NET will behave like previous versions of ASP, in providing access to the resources.

In ASP.NET, you first need to check whether the application is configured to use impersonation. In the case of IIS, the IIS impersonates users with its own IUSR account. In the case of ASP.NET, impersonation is used to decide whether the user's request should be executed using the account of the requested user, or that of a local system-process account that ASP.NET uses for anonymous requests.

The concept of impersonation is complex to some extent due to the fact that ASP.NET uses the dynamic compilation features of the .NET Framework. The IUSR account has only limited permissions on the local machine, and so is not suitable without some reconfiguration. This account is also used by IIS to access resources like HTML pages, documents, and zip files that are not executed as part of the .NET Framework.

If impersonation is enabled in an ASP.NET application then:
• If anonymous access is enabled in IIS, the request is made using the IUSR_machinename account.
• If anonymous access is disabled in IIS, the request is made using the account of the authenticated user.
• In either case, permissions for the account are checked in the Windows Access Control List (ACL) for the resource(s) that a user requests, and a resource is only available if the account they are running under is valid for that resource.

If impersonation is disabled in an ASP.NET application then:
• If anonymous access is enabled in IIS, the request is made using the system-level process account.
• If anonymous access is disabled in IIS, the request is made using the account of the authenticated user.
• In either case, permissions for the account are checked in the Windows ACL for the resource(s) that a user requests, and a resource is only available if the account they are running under is valid for that resource.

Friday, January 22, 2010 5:51:33 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 

a) PRE JIT : It Compiles complete source code to native caode In a single Compilation.

b) ECONO JIT : It compiles only those methods that are called at Runtime.

c) NORMAL JIT : It compiles only those methods that are called at Runtime and are stored in cache.

Friday, January 22, 2010 5:48:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Association represents the ability of one instance to send a message to another instance. This is typically implemented with a pointer or reference instance variable, although it might also be implemented as a method argument, or the creation of a local variable.

Aggregation is the typical whole/part relationship. This is exactly the same as an association with the exception that instances cannot have cyclic aggregation relationships (i.e. a part cannot contain its whole).
The fact that this is aggregation means that the instances of Node cannot form a cycle. Thus, this is a Tree of Nodes not a graph of Nodes.


Composition is exactly like Aggregation except that the lifetime of the 'part' is controlled by the 'whole'. This control may be direct or transitive. That is, the 'whole' may take direct responsibility for creating or destroying the 'part', or it may accept an already created part, and later pass it on to some other whole that assumes responsibility for it.

Friday, January 22, 2010 5:45:21 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

XSLT is a rule based language used to transform XML documents in to other file formats. XSLT are nothing but generic transformation rules which can be applied to transform XML document to HTML, CS, Rich text etc. the XSLT processor takes the XML file and applies the XSLT transformation to produce a different document.

XPATH It is an XML query language to select specific parts of an XML document. Using XPATH you can address or filter elements and text in a XML document. For instance a simple XPATH expression like "Invoice/Amount" states find "Amount" node which are children of "Invoice" node.

Friday, January 22, 2010 5:39:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

MSXML supports XMLDOM and SAX parsers while .NET framework XML classes support XML DOM and XML readers and writers.

MSXML supports asynchronous loading and validation while parsing. For instance you can send synchronous and asynchronous calls to a remote URL. But as such there is not direct support of synchronous and asynchronous calls in .NET framework XML. But same can be achieved by using "System.Net" namespaces.

Friday, January 22, 2010 5:33:56 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

"System.xml.dll" is the actual physical file which has all XML implementation. Below are the commonly used namespaces:-

√ System.Xml

√ System.Xml.Schema

√ System.Xml.XPath

√ System.Xml.Xsl

Friday, January 22, 2010 5:32:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

XSL (the eXtensible Stylesheet Language) is used to transform XML document to some other document. So its transformation document which can convert XML to some other document. For instance you can apply XSL to XML and convert it to HTML document or probably CSV files.

Friday, January 22, 2010 5:30:50 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

All data is normally parsed in XML but if you want to exclude some elements you will need to put those elements in CDATA.

With CSS you can format a XML document.

Friday, January 22, 2010 5:30:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

If a XML document is confirming to XML rules (all tags started are closed, there is a root element etc) then it’s a well formed XML.

If XML is confirming to DTD rules then it’s a valid XML.

Friday, January 22, 2010 5:29:16 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

It defines how your XML should structure. For instance in the above XML we want to make it compulsory to provide "qty" and "totalcost", also that these two elements can only contain numeric. So you can define the DTD document and use that DTD document with in that XML

Friday, January 22, 2010 5:28:11 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

Note: - This is an interview question where the interviewer wants to know why you have chosen XML. Remember XML was meant to exchange data between two entities as you can define your user friendly tags with ease. In real world scenarios XML is meant to exchange data. For instance you have two applications who want to exchange information. But because they work in two complete opposite technologies it’s difficult to do it technically. For instance one application is made in JAVA and the other in .NET. But both languages understand XML so one of the applications will spit XML file which will be consumed and parsed by other applications You can give a scenario of two applications which are working separately and how you chose XML as the data transport medium.

Friday, January 22, 2010 5:24:34 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

No, they both go together one is for describing data while other is for displaying data.

Friday, January 22, 2010 5:23:55 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

XML describes data while HTML describes how the data should be displayed. So HTML is about displaying information while XML is about describing information.

Friday, January 22, 2010 5:22:08 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

Yes, they are case sensitive.

Friday, January 22, 2010 5:21:37 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

No, every tag in XML which is opened should have a closing tag.

Friday, January 22, 2010 5:21:13 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 

XML (Extensible markup language) is all about describing data. Below is a XML which describes invoice data.

<?xml version="1.0" encoding="utf-8"?>
<
Product>
   <
productname>Shoes</productname>
   <
qty>12</qty>
   <
totalcost>100</totalcost>
   <
discount>10</discount>
</
Product>

An XML tag is not something predefined but it is something you have to define according to your needs. For instance in the above example of invoice all tags are defined according to business needs. The XML document is self explanatory, any one can easily understand looking at the XML data what exactly it means.

Friday, January 22, 2010 5:20:13 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 
# Wednesday, January 20, 2010

In software engineering (or computer science), a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved. Algorithms are not thought of as design patterns, since they solve computational problems rather than design problems.

 

Design patterns can be classified in terms of the underlying problem they solve.

 

 

  Creational Patterns -- concern the process of object creation.

  Abstract Factory

Provide an interface for creating families of related or dependent objects without specifying their concrete classes.

 

 

  Builder

 Separates the construction of a complex object from its representation so that several different representations can be created, depending on the needs of the program.

 

  Factory Method

Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation

 

  Prototype

The Prototype pattern starts with an instantiated class and copies or clones it to make new instances. These instances can then be further tailored using their public methods.

 

  Singleton

The Singleton pattern is a class of which there can be no more than one instance. It provides a single global point of access to that instance.

 

 

  Structural Patterns -- describe how classes and objects can be combined to form larger structures.

  Adapter

Convert the interface of a class into another interface clients expect.

Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.

 

  Bridge

Decouple an abstraction from its implementation so that the two can vary independently.

 

  Composite

Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and Compositions of objects uniformly.

 

  Decorator

Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

 

  Facade

Provide a unified interface to a set of interfaces in a subsystem. Façade defines a higher-level interface that makes the subsystem easier to use.

 

  Flyweight

Use sharing to support large numbers of fine-grained objects efficiently.

  Proxy

Provide a surrogate or placeholder for another object to control access

to it.

 

  Behavioral Patterns -- characterize the ways in which classes or objects interact and distribute responsibility

  Chain of Resp.

Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.

 

  Command

Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.

 

  Interpreter

Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.

 

  Iterator

Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

 

  Mediator

Define an object that encapsulates how a set of objects interact.

Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.

 

  Memento

Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.

 

  Observer

Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

 

  State

Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.

 

  Strategy

Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

 

  Template Method

  Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.

 

  Visitor

  Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

 

 

Wednesday, January 20, 2010 6:48:52 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

1MW 1 Microsoft Way
1TBS 1 True Brace Style
21D teach yourself ___ in 21 Days
3COM COMputer, COMmunication, COMpatibility
3Dwm 3-Dimensional Window Manager
3G 3rd Generation
3GIO 3rd Generation Input/Output
3GL 3rd Generation Language
3LD 3rd-Level Domain {IANA}
3NF 3rd Normal Form (databases)
3W World Wide Web
4GL 4th Generation Language
4WCD 4 Wire Conditioned Diphase
A/D Analog/Digital
A/UX Apple UniX
A2A Application TO Application
AA Administrative Authority
AA AntiAliasing
AAA Administration, Authorization, and Authentication (security)
AAA Asp Application Aggregator
AAAI American Association for Artificial Inelligence
AAB All-to-All Broadcast
AAC Advanced Audio Coding
AAEPS Anywhere Anytime Email Proxy Server
AAF Advanced Authoring Format
AAL Atm Abstraction Layer
AAMOF As A Matter Of Fact {chat}
AAP Application Access Point
AARP Appletalk Address Resolution Protocol {Apple}
AART Aggregate Average Response Time
AAS All-to-All Scatter
AAS Auto Area Segmentation
AASE Associate Accredited Systems Engineer {Compaq}
AASP Ascii Asynchronous Support Package
AAT Average Access Time
AAUI Apple Attachment Unit Interface {Apple}
ABA Address Book Archive
ABAP Advanced Business Application Programming
ABC A Bit Cypher
ABC Atanasoff-Berry Computer
ABCPP ABC PreProcessor
ABEL Advanced Boolean Expression Language
ABEND ABnormal END
ABGP
ABI Abstract Binary Interface
ABI Adaptive Brain Interface
ABI Application Binary Interface
ABIOS Advanced Basic Input/Output System
ABIST Automatic Built-In Self Test
ABLE Adaptive Battery Life Extender
ABM Anything But Microsoft
ABM Asynchronous Balanced Mode
ABNF Augmented Backus Normal Form
ABNF Augmented Backus-Naur Form
ABR Area Border Router
ABR Auto Band Rate
ABR Available Bit Rate
.
.
.
And retrieve the complete list fromt the attached Word document.

The definitive Acronym list.doc (1.06 MB)

Wednesday, January 20, 2010 5:19:02 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   General  | 
# Monday, January 18, 2010

TYPES OF QUESTIONS
1. Close-ended questions. These questions may sometimes be helpful when an interviewer(s) wants to know certain information at the onset or needs to determine specific kinds of knowledge. Example: "Could you name the five specific applications involved in...?"
2. Probing questions. These questions allow the interviewer(s) to delve deeper for needed information. Example: "Why?", "What caused that to happen?", or "Under what circumstances did that occur?"
3. Hypothetical questions. Hypothetical situations based on specific job-related facts are presented to the applicant for solutions. Example: "What would you do if..", "How would you handle..."
4. Loaded questions. These questions force an applicant to choose between two undesirable alternatives. The most effective way to employ a loaded question is to recall a real-life situation where two divergent approaches were both carefully considered, then frame the situation as a question starting with, "What would be your approach to a situation where...".
5. Leading questions. The interviewer(s) sets up the question so that the applicant provides the desired response. When leading questions are asked, the interviewer cannot hope to learn anything about the applicant.
6. Open-ended questions. These are the most effective questions, yield the greatest amount of information, and allow the applicant latitude in responding. Example: "What did you like about your last job?"
Examples of open-ended effective probing:
1. What are/were the three main responsibilities in your current/last position? Which responsibilities do/did you enjoy the most? Why?
2. Of the three main responsibilities, which do/did you enjoy the least? Why?
3. Describe your supervisor's management style. Did/Do you like his or her style of management? Why or why not?
4. Describe your particular style of management, or the style of management you would choose if you were a manager.
5. In the past have you worked in a team environment or independently? Which did you prefer and why?
6. What amount of hours do you/ did you put in at your current/last position? How did you feel about working those hours? 
7. What are three of your strongest work related qualities and how were you able to demonstrate these on your job?
8. What are three areas, with regard to your work, that you would like the opportunity to develop?
9. Why did you/are you leave/leaving your last/present position?
10. Of all the jobs you've held, which one did you like the most and why?
11. What major problems have you encountered so far in your professional life and how did you deal with them?
12. What have you learned from your mistakes?
13. How do you react to pressure?
14. What types of decisions are most difficult for you?
15. How have your prior experiences and education prepared you for this job?
16. What has been your biggest work-related frustration to date? How did you handle the situation?
17. Have you ever supervised anyone in a work setting? Have you ever hired or fired anyone?
18. What experience do you have in this field? How have you prepared yourself to switch fields?
19. How have you influenced productivity and results in your previous work experiences?
20. How have you prepared yourself to assume the challenges of this position?
21. How do your current skills apply to this position?
22. In what ways do you expect your relationships with current peers to change? How will you manage this shift?
Repeated Questions break rehearsed answers
1. What did you like about your previous job/manager?
2. What else did you like about your previous job/manager?

Monday, January 18, 2010 8:35:21 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   General  | 

In some cases, using view state is not feasible. The alternative for view state is session state. Session state is employed under the following situations:

o        Large amounts of data - View state tends to increase the size of both the HTML page sent to the browser and the size of form posted back. Hence session state is used.

o        Secure data - Though the view state data is encoded and may be encrypted, it is better and secure if no sensitive data is sent to the client. Thus, session state is a more secure option.

o        Problems in serializing of objects into view state - View state is efficient for a small set of data. Other types like DataSet are slower and can generate a very large view state.

Monday, January 18, 2010 6:02:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Thursday, January 14, 2010

I have tested it using window application of C#,  In this we have two Hexadecimal value, And we check that the source value exists in our database or not.

        public Test()
        {
            InitializeComponent();

            //8 Byte Hexadecimal Value of source
            this.txtSource.Text = "0x00004000";

            //8 Byte Hexadecimal Value of DB
            this.txtDB.Text = "0xAF00D0b0";
        }

        private void button1_Click(object sender, EventArgs e)
        
        {
            //Convert the Hexadecimal value inot uint.
            uint i = GetHexValue(txtDB.Text.ToString());
            uint b = GetHexValue(txtSource.Text.ToString());
            
            txtResult.Text = (i & b) > 0 ? "Match" : "UnMatch";
        }

        //This is the function used for returning uint value from hexadecimal value.
        public uint GetHexValue(String text)
        {
            uint result = 0;
            String parseText = text;
            if (parseText.StartsWith("0x", true, CultureInfo.InvariantCulture))
            {
                parseText = text.Substring(2);
            }


            if (UInt32.TryParse(parseText, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out result) == false)
            {
                throw new ArgumentException("Text value must be a valid hexidecimal number" + text);
            }

            return result;
        }

 

Thursday, January 14, 2010 10:27:06 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   C#  | 

There are three levels of data modeling. They are conceptual, logical, and physical. This section will explain the difference among the three, the order with which each one is created, and how to go from one level to the other.

Conceptual Data Model

Features of conceptual data model include:

  • Includes the important entities and the relationships among them.
  • No attribute is specified.
  • No primary key is specified.

At this level, the data modeler attempts to identify the highest-level relationships among the different entities.

Logical Data Model

Features of logical data model include:

  • Includes all entities and relationships among them.
  • All attributes for each entity are specified.
  • The primary key for each entity specified.
  • Foreign keys (keys identifying the relationship between different entities) are specified.
  • Normalization occurs at this level.

At this level, the data modeler attempts to describe the data in as much detail as possible, without regard to how they will be physically implemented in the database.

In data warehousing, it is common for the conceptual data model and the logical data model to be combined into a single step (deliverable).

The steps for designing the logical data model are as follows:

  1. Identify all entities.
  2. Specify primary keys for all entities.
  3. Find the relationships between different entities.
  4. Find all attributes for each entity.
  5. Resolve many-to-many relationships.
  6. Normalization.

Physical Data Model

Features of physical data model include:

  • Specification all tables and columns.
  • Foreign keys are used to identify relationships between tables.
  • Denormalization may occur based on user requirements.
  • Physical considerations may cause the physical data model to be quite different from the logical data model.

At this level, the data modeler will specify how the logical data model will be realized in the database schema.

The steps for physical data model design are as follows:

  1. Convert entities into tables.
  2. Convert relationships into foreign keys.
  3. Convert attributes into columns.
  4. Modify the physical data model based on physical constraints / requirements.
Thursday, January 14, 2010 5:56:21 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Monday, January 11, 2010

Hi My Team,

 

It’s really painful to leave you all; you all have made my path to grow in Company Name Love, support, care, faith everything that I received from my team will always be with me and I hope I’ll be in your memories for a very long time, specially when one will see “yellow error page” due to framework.

 

One thing I would love to say is, we all are very lucky for having such an admirable leader who seldom acts as lead but as a guardian always, so thanks a lot Lovely sir for everything you did, for your support and faith, I wish one day I’ll join you again.

 

I’ll try my best to be in touch, but if I failed I hope you people will keep me in touch.

 

All the best for you all!!!

 

Soon I’ll update you with my new contact no., my mail id is: Your Email Address

Monday, January 11, 2010 11:07:15 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Letter Format  | 
# Thursday, January 07, 2010

Conceptual Design

A conceptual design is an abstract or high level design which includes only the most important components and entities. The main goal of a conceptual design is to provide an understandable picture of the overall purpose of the proposed solution. Components may include major technology systems, external systems that are required for integration or overall functionality, high level data flow, and system functionality. Think of this as the "black box" diagram where portions of the diagram may be simply a technology component to-be-named-later but is identified with its role and purpose.

Logical Design

A logical design is a more detailed design which includes all major components and entities plus their relationships. The data flows and connections are detailed in this stage. The target audience is typically developers or other systems architects. However, it is possible to create logical designs for business purposes to ensure that all components and functionality is accounted and well understood. Logical designs do not include physical server names or addresses. They do include any business services, application names and details, and other relevant information for development purposes.

Physical Design

A physical design has all major components and entities identified within specific physical servers and locations or specific software services, objects, or solutions. Include all known details such as operating systems, version numbers, and even patches that are relevant. Any physical constraints or limitations should also be identified within the server components, data flows, or connections. This design usually precludes or may be included and extended by the final implementation team into an implementation design.

Thursday, January 07, 2010 5:54:42 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   General  | 
# Monday, January 04, 2010

A private constructor is a special instance constructor. It is commonly used in classes that contain static members only. If a class has one or more private constructors and no public constructors, then other classes (except nested classes) are not allowed to create instances of this class.

Monday, January 04, 2010 5:43:02 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Friday, January 01, 2010

The XML API for the .NET Framework comprises the following set of functionalities:

XML readers: With XML readers the client application get reference to instance of reader class. Reader class allows you to scroll forward through the contents like moving from node to node or element to element. You can compare it with the "SqlDataReader" object in ADO.NET which is forward only. In short XML reader allows you to browse through the XML document.

XML writers Using XML writers you can store the XML contents to any other storage media. For instance you want to store the whole in memory XML to a physical file or any other media.

XML document classes XML documents provides a in memory representation for the data in an XMLDOM structure as defined by W3C. It also supports browsing and editing of the document. So it gives you a complete memory tree structure representation of your XML document.

Friday, January 01, 2010 5:37:07 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   XML Interview Question  | 
# Tuesday, December 29, 2009

A-type HIP

See HIP processing definition

AAP Options

WORLDSPAN Agent Assisted Pricing options.  These options, append to 4P entries, can force a particular fare construction.

Africa

Comprises of Central Africa, Eastern Africa, Indian Ocean Islands, Libya, Southern Africa, Western Africa

Airline Pricing Profile

WORLDSPAN Internal Table controlling Carrier Specific preferences addressing specific issues, i.e. Fare Construction Application.

Area 1 (TC1)

All of the North and South American Continents and the adjacent Islands;  Central America, Greenland, Bermuda, the West Indies and the islands of the Caribbean Sea, the Hawaiian Islands (including Midway and Palmyra)

Area 2 (TC2)

All of Europe as defined below and adjacent islands;  Iceland. the Azores, all of Africa and adjacent islands, Ascension Island, that part of Asia lying west of and including Iran.

Area 3 (TC3)

All of Asia and the adjacent islands except that portion included in Area 2;  all of the East Indies, Australia, New Zealand, and the adjacent islands of the Pacific Ocean, except those included in Area 1.

Back Haul

A fare construction applied to a fare sector to determine the minimum applicable fare, only when all of the following conditions apply:

     a.  the journey is a one way journey, or an open jaw journey where the surface break is neither in the country of origin, country of turnaround, or both, and

     b.  a higher intermediate fare is assessed, and

     c.  a higher intermediate point exists from the point of origin to a stopover point in the fare component

Backhaul Minimum

The additional amount that must be added to a fare calculation as the result of a backhaul calculation.

Central Africa

·         Malawi, Zambia, Zimbabwe

Circle Trip (CT)

Travel from a point and return thereto by a continuous, circuitous air route, including journeys comprising of two or more than two fare components , where in the outbound and inbound fare amounts (including mileage surcharges  and higher intermediate fares) are not the same and do not meet the conditions of the round trip definition.

     Travel from one point and return to the same point by a continuous, circuitous air travel:

     where travel from and to the same point for which different inbound and outbound fare apply in the lowest class of service used and/or,

     where a higher intermediate point or mileage surcharge is assessed, and/or

     where more than two fare components apply for the journey


 

Circle Trip Minimum (CTM)

 

The additional amount that must be added to a fare calculation as the result of a circle trip minimum calculation.

 

Circle Trip - Normal Fare

Travel from a point and return by a continuous, circuitous air route by use of two (2) or more components.  Closed journeys comprising two (2) fare components, only  which do not meet the conditions of a round trip are also considered to be circle trip.

 

Circle Trip - Special Fares

Travel from a point and return thereto by a continuous, circuitous air route, comprising only two international fare components which do not meet the conditions of  a round trip definition; provided that where no reasonable direct scheduled air route is available between two points, a break in the circle trip between two fare construction points may be traveled by any other means of transportation without prejudice to the circle trip.  (per draft amendment from May’97 RAP meeting)

Combination

 

Whenever two or more one way or round trip or half round trip fares are used and shown separately in a fare calculation.

 

Common Point Minimum (CPM)

A fare construction applied to a fare sector to determine the minimum applicable fare, only when all of the following conditions apply:

     where a journey comprises not more than two international fare components with a Domestic Surface Sector and travel is via a Common Ticketed Point in the Country of Origin/Turnaround, the fare for the entire journey shall not be less than the applicable fare, from/to such common points

 

Component

A fare break point.

Constructed Fare

Unspecified through fares created by the use of add-on amounts, ot two or more fares shown as a single amount in a fare calculation.

Continent

 

For travel purposes, continent refers to a political grouping of countries, and does not necessarily correspond geographically.

 

Continental USA

the 48 contiguous States and the District of Columbia (this does not include Alaska, Hawaii)

Country of Commencement of Transportation

The country from which travel on the first international sector take place

Country of Payment

The country where payment is made by the purchaser to the TC Member or its Agent;  payment by check, credit card or other banking instruments shall be deemed to have been made at the place where such instrument is accepted by the TC Member or its Agent

Country of Unit Origin

The country in which the unit origin is situated

Currency of the Country of Payment

The currency in which international fares from that country are denominated

Destination

 

The ultimate stopping place of the journey as shown on the ticket.

 

Differential

 

The difference between normal fares for the higher and lower classes of service for the segments(s) where the higher class of service is flown.

 

Direct Route

 

Direct Route Fare

 

The fare applicable to the direct route between two points, without regard to actual routing or stopover.  When no direct route fare exists between two ticketed points a fare must be established by combination over a ticketed point on the itinerary.

Direct Route

 

Eastern Africa

·         Burundi, Djbouti, Eritrea, Ethiopia, Kenya, Rwanda, Somalia

·         Tanzania, Uganda

EC Member States

·         Austria , Belgium, Denmark, Finland, France, Germany, Greece

·         Iceland, Ireland, Italy, Luxembourg, the Netherlands

·         Portugal, Spain, Sweden, the United Kingdom

End on Combination (EOE)

 

Combination of two or more fares which could be ticketed separately at a fare construction point. (not applicable to combination of fares between the same points)

Fare Applicable

For Fare construction purposes, a fare which is established after the application of all fare construction calculations, e.g. excess mileage fare , higher intermediate fare

Fare Break Points

see Fare Construction Points

Fare Component (FC)

 

The portion of an itinerary between two fare construction points. (these are also termed fare break points)

 

Fare Construction Points

 

The manner in which fare break points have been determined.

 

Fare, Direct

For fare construction purposes, a fare component (these are also termed fare break points)

Far so Far (FSF)

 

The total accumulated fare for a priceable unit including HIPs and mileage surcharges.

Global Indicator (GI)

 

The global routing applicable to the fare as shown in IATA Attacment ‘A’ to RESO 011

The global routing applicable to the fare, as shown in the fare display.  A sample listing is illustrated below:

AF       -           via Africa

AP       -           via the Atlantic and Pacific (via Area 1)

AT       -           via the Atlantic

EH       -           within the Eastern Hemisphere

FE        -           via the Far East

PA       -           via the South, Central, or North Pacific

PO       -           via the North Polar route

T3        -           between the USSR and South East Asia / Japan / Korea;

                        between Moscow and the South West Pacific

TS        -           via Siberia (MOW) and/or nonstop between Europe and Japan / Korea

 

 

Half Round Trip Fares

 

     Normal Fares - One half of the round trip published amount between two points , or the one way published amount between two points when no round trip is published.

     Special Fares - One half of the published round trip amount between two points, or the one way published amount whenever that one way fare may be doubled to establish a round trip fare.

 

Higher intermediate Point (HIP)

A ticketed point between origin and destination of a fare sector for which a higher fare is published.

HIP Processing

Higher Intermediate Point Processing is used to determine if an International through trip's fare is exceeded by any intermediate point's fares.  There are four (4) types of HIP checks:

     A-type compares fares from origin to intermediate points with the fares for the whole trip.

     B-type compares fares from intermediate points to an offpoint with the fares for the whole trip.

     C-type compares fares between intermediate points with the fares for the whole trip.

     CP or P-type is a common point check.  Occurs only in open - jaw itineraries.  Compares fares from common point to other ticketed points in a trip.  NOTE a common point doesn't have to be a stopover.

Indian Ocean Islands

·         Comoros, Madagascar, Mauritius, Mayotte, Reunion, Seychelles

Industry Product Codes

An WORLDSPAN in-house method used to establish a hierarchy of fare type values.

Interline Transfer

Transfer from the service of one carrier to the service of another carrier

International Transfer

A change from the international service of one carrier to another international service of the same carrier (online transfer) or to the international service of another carrier (interline transfer)

Intermediate Ticketed Point

Any ticketed point other than the origin or destination of a fare sector.


 

International Sales Indicator Codes (ISI)

 

One of  four codes that must be included in the origin and destination box of each international ticket. SITI/SITO/SOTI/SOTO

For the purpose of determining ticketing transaction codes, the United States and Canada, or Denmark, Norway, and Sweden shall be considered on country.

 

S I T I

Indicates the sale and ticket issuance are both in the country of commencement of  transportation.

SITI will also apply to tickets:

 

S I T O

Indicates the sale  is made in the country of commencement of  transportation and ticket   issuance is outside the country of commencement  of transportation.

 

S O T I

Indicates the sales is outside the country of commencement of  transportation and the ticket issuance is in the country of commencement of  transportation.

 

S O T O

Indicates the sale and ticket issuance are both outside the country of commencement of transportation.

Journey

 

Origin to destination of the entire ticket.

Local Combination

Combination of fares between the same points

Local Currency Fares

Fares and related charges expressed in the currency of the country of commencement of travel;  see RESO 024a for those countries where the US Dollar is used for local currency

Maximum Permitted Mileage (MPM)

 

Miles published in connection with a fare, governing the maximum distance a passenger is allowed to travel enroute between two particular points at the direct fare.

 

Non-IATA Carrier

Any carrier who is not a Member of IATA

Non-TC Member

A Member of IATA who has elected not to participate in Tariff Coordinating Conferences

Normal Fare (NL)

 

The full fare established for First, Business, or Economy class of service.  Fares with no limited ticket validity or other restrictions with the possible exception of transfers, stopovers, or seasonality.

North America

(for WORLDSPAN pricing)  Alaska, Canada, Continental USA, and Hawaii.

Neutral Units of Construction (NUC)

The neutral unit of construction used in fare construction.

 

OFF trip

Within minimum processing, the OFF trip is the remainder of the priceable unit, i.e. the portion that is not part of the HIP trip.


 

One Way (OW)

 

Considered to be any journey which, for fare calculation purposes, is not a complete round trip , circle trip, or other than round trip / circle trip (open jaw).

One Way Subjourney

Part of a journey wherin travel from one country does not return to such country and for which the fare is assessed as a single pricing unit using a one way fare  (effective with PUC 6/1/00)

On-Line Transfer

 

Open Jaw, Normal

 

Travel from one country and return thereto with a domestic surface break in one country either at unit origin or unit turnaround, or a surface break at both unit origin and unit turnaround  (per draft amendment definition from May’97 RAP meeting)

In this context:

·         turnaround open jaw shall mean whee the outward point of arrival in the country of unit turnaround and the inward point of departure in the country of unit turnaround are different.

·         origin open jaw shall mean where the outward point of departure in the country of unit origin and the inward point of arrival in the country of unit origin are different.

Except:

·         for travel originating in Canada and USA, the surface break may be permitted between countries in the Europe Sub-area: provided travel in both directions is via the Atlantic.

·         Canada, USA shall be considered as one country.

·         Denmark, Norway, and Sweden are considered on country.

Open Jaw - Special Fares

travel comprising two (2) international fare components whereby

·         for turnaround open jaw the outward point of arrival and the inward point of departure are different, or

·         for origin open jaw the outward point of departure and the inward point of arrival are different, or

·         for single open jaw either a) or b) applies, or

·         for open jaw any combination of the above may apply.

Origin

The initial starting place of the journey as shown on the ticket

Priceable Unit

A journey or part of a journey which is priced as a separate entity, e.g. is capable of being ticketed separately.  A complete journey, if a single Pricing Unit , or part of a journey which is priced as a separate entity (is capable of being ticketed separately).  A pricing unit comprises a single One Way fare component or a complete Round Trip / Circle Trip / Open Jaw Fare.

Return Subjourney

Part of a journey wherein travel is from a point / country and return thereto and for which the fare is assessed as a single pricing unit using half-round-trip, circle trip, normal fare open jaw; all applicable to special fare open jaw returning to the same of another country (effective with PUC 6/1/00)


 

Round the World (RTW)

Differing Global Indicators

Travel from the point of origin and return thereto which involves only one crossing of the Atlantic Ocean and only one crossing of the Pacific Ocean.

Round Trip (RT)

 

(excluding Round the World - RTW)

A journey comprised of not more than two fare components, from one point and return to the same point.  When determining if a round trip journey exists, the applicable normal fare (including mileage surcharges and higher intermediate fares) both outbound and inbound must be equal,  regardless of construction.  If the fares to be used differ through class of service / seasonality / midweek-weekend / carrier variations, the outbound fare shall be used also for the inbound fare component for the purpose of determining if the journey is a round trip.

Routing

The carrier(s) and cities by and between which transportation is provided.

 

Scandinavia

Denmark, Norway, Sweden

 

Side Trip

Travel from and/or to an enroute point of a fare component.

Side Trip Combination

The combination of a fare which could be ticketed separately from and/or to an enroute point of a fare component.

Significant Carrier

The carrier whose fares are applicable for a fare component.

Significant segments

The flight segment used in international pricing which makes a travel conference (TC) break, country, continent, or sub-continental change.

South Africa

 

Special Fare (SP)

Any fare other than a normal fare

Specified Fare

A fare in an IATA Tariff Conference Resolution

Subjourney

A subjourney is a self-contained One Way / Round Trip / Circle Trip / Open Jaw Princing Unit whcih is combined with (an) other self-contained One Way / Round Trip / Circle Trip / Open Jaw Pricing Units(s) on the same ticket, e.g. one complete journey divided into separately priced subjourneys.

TC Member

A Member of IATA who has elected to participate in Tariff Coordinating Conferences

Through Fare

A fare applicable for travel between two consecutive fare construction points via an intermediate point(s)

Ticketed Point Mileage (TPM)

The distance between pairs of points published in the Ticketed Point Mileage Manual using non-stop sector mileages in accordance with RESO 011, Ticketed point mileage.  The shortest operated mileage between ticketed points.

Ticketed Point

Points shown in the "good for passage" section of the passenger ticket.

Transfer

A change from the service of one carrier to another service of the same carrier (online transfer) or to the service of another carrier (interline transfer)

Trip Origin

First point in the fare component.


 

Unit Destination

The ultimate stopping place of a pricing unit

Unit Origin

The initial starting point of a pricing unit

USA

The 50 States, District of Columbia, Puerto Rico and US Virgin Islands

USA Teritories

The overseas teritories of the United States of America, including but not limited to

·         American Samoa, Baker Island, Guam, Howland Island, Jarvis Island

·         Jonston Atoll, Kingman Reef, Midway Island, Northern Mariana Islands

·         Saipan, Swains Islands, Pacific Trust Territories, Palmyra Island

·         Panama Canal Zone, Wake Island

Validated

Fare which has passed rules and routings

VIA points

All ticketed points between the board and off point of a trip.

Western Africa

·         Angola, Benin, Burkina Faso, Cameroon, Cape Verde

·         Central African Republic, Chad, Congo, Cote d’ lovoire

·         Equatorial Guinea, Gabon, Gambia, Ghana, Guinea, Guinea Bissau

·         Liberia, Mali, Mauritania, Niger, Nigeria, Sao Tome & Principe

·         Senegal, Sierra Leone, Togo, Zaire

 

Tuesday, December 29, 2009 11:33:33 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Travel Domain  | 

Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).

There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and uses SoapFormatter/BinaryFormatter for remoting. Both are available for use in your own code.

Tuesday, December 29, 2009 11:06:42 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

An AppDomain can be thought of as a lightweight process. Multiple AppDomains can exist inside a Win32 process. The primary purpose of the AppDomain is to isolate an application from other applications.

Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn't scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.

Tuesday, December 29, 2009 11:05:06 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
  • ASP.NET based Web services can only be accessed over HTTP. .NET Remoting can be used across any protocol.
  • Web services work in a stateless environment where each request results in a new object created to service the request. .NET Remoting supports state management options and can correlate multiple calls from the same client and support callbacks.
  • Web services serialize objects through XML contained in the SOAP messages and can thus only handle items that can be fully expressed in XML. .NET Remoting relies on the existence of the common language runtime assemblies that contain information about data types. This limits the information that must be passed about an object and allows objects to be passed by value or by reference.
  • Web services support interoperability across platforms and are good for heterogeneous environments. .NET Remoting requires the clients be built using .NET, or another framework that supports .NET Remoting, which means a homogeneous environment.
Tuesday, December 29, 2009 9:28:24 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Multithreading also comes with disadvantages. The biggest is that it can lead to vastly more complex programs. Having multiple threads does not in itself create complexity; it's the interaction between the threads that creates complexity. This applies whether or not the interaction is intentional, and can result long development cycles, as well as an ongoing susceptibility to intermittent and non-reproducable bugs. For this reason, it pays to keep such interaction in a multi-threaded design simple – or not use multithreading at all – unless you have a peculiar penchant for re-writing and debugging!

Multithreading also comes with a resource and CPU cost in allocating and switching threads if used excessively. In particular, when heavy disk I/O is involved, it can be faster to have just one or two workers thread performing tasks in sequence, rather than having a multitude of threads each executing a task at the same time. Later we describe how to implement a Producer/Consumer queue, which provides just this functionality.

Tuesday, December 29, 2009 4:33:30 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

All threads within a single application are logically contained within a process – the operating system unit in which an application runs.

Threads have certain similarities to processes – for instance, processes are typically time-sliced with other processes running on the computer in much the same way as threads within a single C# application. The key difference is that processes are fully isolated from each other; threads share (heap) memory with other threads running in the same application. This is what makes threads useful: one thread can be fetching data in the background, while another thread is
displaying the data as it arrives.

Tuesday, December 29, 2009 3:56:31 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Multithreading is managed internally by a thread scheduler, a function the CLR typically delegates to the operating system. A thread scheduler ensures all active threads are allocated appropriate execution time, and that threads that are waiting or blocked – for instance – on an exclusive lock, or on user input – do not consume CPU time.

On a single-processor computer, a thread scheduler performs time-slicing – rapidly switching execution between each of the active threads.

On a multi-processor computer, multithreading is implemented with a mixture of time-slicing and genuine concurrency – where different threads run code simultaneously on different CPUs. It's almost certain there will still be some time-slicing, because of the operating system's need to service its own threads – as well as those of other applications.

A thread is said to be preempted when its execution is interrupted due to an external factor such as time-slicing. In most situations, a thread has no control over when and where it's preempted.

Tuesday, December 29, 2009 3:55:04 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Monday, December 28, 2009

One Sentence summary of the purpose of the UML Model:


1. Use Cases - "How will our system interact with the outside world?"
2. Class Diagram - "What objects do we need? How will they be related?"
3. Collaboration Diagram - "How will the object interact?"
4. Sequence Diagram - "How will the objects interact?"
5. State Diagram - "What stats should our objects be in?"
6. Package Diagram -"Show are we going to modularise our development?"
7. Component Diagram -"How will our software components be related?"
8. Deployment Diagram -"How will the software be deployed?"

Monday, December 28, 2009 12:29:30 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   UML  | 
# Tuesday, December 22, 2009

The passenger traveling at the fare being validated that is required to travel with another passenger.

Tuesday, December 22, 2009 6:27:35 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Travel Domain  | 

In an interface class, all methods are abstract - there is no implementation. 

In an abstract class some methods can be concrete.  In an interface class, no accessibility modifiers are allowed. 

An abstract class may have accessibility modifiers. 
 

Tuesday, December 22, 2009 5:54:55 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Yes.  .NET does support multiple interfaces. 

Tuesday, December 22, 2009 5:53:27 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

They all must be public, and are therefore public by default. 

Tuesday, December 22, 2009 5:53:01 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Interfaces, like classes, define a set of properties, methods, and events. But unlike classes, interfaces do not provide implementation. They are implemented by classes, and defined as separate entities from classes. 

Tuesday, December 22, 2009 5:52:30 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

A class that cannot be instantiated.  An abstract class is a class that must be inherited and have the methods overridden.  An abstract class is essentially a blueprint for a class  with or without implementation. 

Tuesday, December 22, 2009 5:50:36 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Yes.  Just leave the class public and make the method sealed. 

Tuesday, December 22, 2009 5:49:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Yes.  The keyword “sealed” will prevent the class from being inherited. 

Tuesday, December 22, 2009 5:48:26 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

The data value may not be changed.  Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory. 

System.String is immutable.  System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed. 

Tuesday, December 22, 2009 5:47:19 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

It is available to classes that are within the same assembly and derived from the specified base class. 

Tuesday, December 22, 2009 5:45:42 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Yes, but they are not accessible.  Although they are not visible or accessible via the class interface, they are inherited. 

Tuesday, December 22, 2009 5:44:40 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

No

Tuesday, December 22, 2009 5:43:27 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array.  The CopyTo() method copies the elements into another existing array.  Both perform a shallow copy.  A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array.  A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.

Tuesday, December 22, 2009 5:42:04 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred. 

A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end. 

Tuesday, December 22, 2009 5:39:09 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

It’s a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling

Tuesday, December 22, 2009 5:38:02 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process.  Web Services provide an open-protocol-based exchange of informaion. 

Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.

Tuesday, December 22, 2009 5:36:45 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Monday, December 21, 2009

It’s an application that’s running and had been allocated memory.

A process is an instance of a running application. An application is an executable on the hard drive or network. There can be numerous processes launched of the same application (5 copies of Word running), but 1 process can run just 1 application. 

Monday, December 21, 2009 5:35:37 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Wednesday, December 09, 2009

This is the code, which you will use for stop Services using VBS Script

Function StopServices
 Dim objWMIService,colItems,ObjItem,chkServiceStatus,RetVal
 Set objWMIService = GetObject("winmgmts:\\" & "." & "\root\cimv2")
 Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where name='" & strServiceName & "'",,48)
 For Each ObjItem in colItems
  If (InStr (1,objItem.DisplayName,strServiceName,1) > 0) then
   chkServiceStatus=ObjItem.State
  end if
 Next

 If(ucase(chkServiceStatus)="RUNNING") THEN
  RetVal = goShell.Run("%windir%\system32\sc.exe Stop """ & strServiceName & """ >> " & gcsLogFile,0,True)
   Do Until(Ucase(ServiceStatus)="STOPPED")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where name='" & strServiceName & "'",,48)
    For Each ObjItem in colItems
     If (InStr (1,objItem.DisplayName,strServiceName,1) > 0) then
      ServiceStatus=ObjItem.State
     end if
    Next 
   Loop 
 End If


 
End Function

Wednesday, December 09, 2009 11:43:06 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   VB Script  | 
# Wednesday, December 02, 2009

Pascal casing means that the first letter of each word in a name is capitalized: EmployeeSalary, OrderDetails, PassengerName.

Camel casing is similar to Pascal casing, except that the first letter of the first word in the name is not capitalized:

Wednesday, December 02, 2009 9:35:06 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

The statements that allow us to jump immediately to another line in the program.

There are four jump statement.

  1. Goto
  2. Continue
  3. Break
  4. Return
Wednesday, December 02, 2009 9:17:33 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

constant is a variable whose value cannot be changed throughout its lifetime:

const int abc = 5; // This value cannot be changed

Constants have the following characteristics:

  1. They must be initialized when they are declared, and once a value has been assigned, it can never be overwritten.
  2. The value of a constant must be computable at compile time. Therefore, we can’t initialize a constant with a value taken from a variable. If you need to do this, you will need to use a readonly field.
  3. Constants are always implicitly static. However, notice that we don’t have to include the static modifier in the constant declaration.
Wednesday, December 02, 2009 9:14:20 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

The scope of a variable is the region of code from which the variable can be accessed. In general, the scope is determined by the following rules:

  • A field (also known as a member variable) of a class is in scope for as long as its containing class is in scope (this is the same as for C++, Java, and VB).
  • local variable is in scope until a closing brace indicates the end of the block statement or method in which it was declared.
  • A local variable that is declared in a for, while, or similar statement is in scope in the body of that loop.

Wednesday, December 02, 2009 9:07:39 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

An assembly is the logical unit that contains compiled code targeted at the .NET Framework.

An assembly is completely self-describing, and is a logical rather than a physical unit, which means that it can be stored across more than one file (indeed dynamic assemblies are stored in memory, not on file at all). If an assembly is stored in more than one file, then there will be one main file that contains the entry point and describes the other files in the assembly.

Note that the same assembly structure is used for both executable code and library code. The only real difference is that an executable assembly contains a main program entry point, whereas a library assembly doesn’t.

Assemblies come in two types: shared and private assemblies.


Private Assembly :
------------------
Private assemblies are the simplest type. They normally ship with software and are intended to be used only with that software.

The system guarantees that private assemblies will not be used by other software, because an application may only load private assemblies that are located in the same folder that the main executable is loaded in, or in a subfolder of it.

Shared Assembly :
-----------------
Shared assemblies are intended to be common libraries that any other application can use. Because any other software can access a shared assembly, more precautions need to be taken against the following risks:

  •  Name collisions, where another company’s shared assembly implements types that have the same names as those in your shared assembly. Because client code can theoretically have access to both assemblies simultaneously, this could be a serious problem.
  • The risk of an assembly being overwritten by a different version of the same assembly—the new version being incompatible with some existing client code.
Wednesday, December 02, 2009 8:44:44 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 

Language Interoperability is that classes written in one language should be able to talk directly to classes written in another language.

  • A class written in one language can inherit from a class written in another language.

  • The class can contain an instance of another class, no matter what the languages of the two classes are.

  • An object can directly call methods against another object written in another language.

  • Objects (or references to objects) can be passed around between methods.

  • When calling methods between languages we can step between the method calls in the debugger, even when this means stepping between source code written in different languages.

 

Wednesday, December 02, 2009 5:57:15 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Tuesday, December 01, 2009

Difference between DataGrid and Grid View is given below:-

Datagrid..
1.Code requires to handle the SortCommand event and rebind grid required.
2.Code requires to handle the PageIndexChanged.
3.Need extensive code for update operation on data.
4.When compared to gridview less events supported.

Grid View : ..
1.No code required.
2.No code required for PageIndexChanged.
3.Needs little code for update operation.
4.GridView supports events fired before and after database updates

Tuesday, December 01, 2009 11:34:14 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Thursday, November 19, 2009

Here are several techniques for achieving good coding practices that are less heavy-handed than laying down rigid coding standards:

 

Assign two people to every part of the project

 

If two people have to work on each line of code, you’ll guarantee that at least two people think it works and is readable. The mechanisms for teaming two people can range from pair programming to mentor-trainee pairs to buddy- system reviews.

 

Review every line of code

 

A code review typically involves the programmer and at least two reviewers.  That means that at least three people read every line of code. Another name for  peer review is “peer pressure.” In addition to providing a safety net in case the original programmer leaves the project, reviews improve code quality because the programmer knows that the code will be read by others. Even if your shop hasn’t created explicit coding standards, reviews provide a subtle way of moving toward a group coding standard—decisions are made by the group during reviews, and, over time, the group will derive its own standards.

 

Require code sign-offs

 

In other fields, technical drawings are approved and signed by the managing  engineer. The signature means that to the best of the engineer’s knowledge, the  drawings are technically competent and error-free. Some companies treat code the same way. Before code is considered to be complete, senior technical personnel must sign the code listing.

 

Route good code examples for review

 

A big part of good management is communicating your objectives clearly. One way to communicate your objectives is to circulate good code to your programmers or post it for public display. In doing so, you provide a clear example of the quality you’re aiming for. Similarly, a coding-standards manual can consist mainly of a set of “best code listings.” Identifying certain listings as “best” sets an example for others to follow. Such a manual is easier to update than an English-language standards manual and effortlessly presents subtleties in coding style that are hard to capture point by point in prose descriptions.

 

Emphasize that code listings are public assets

 

Programmers sometimes feel that the code they’ve written is “their code,” as if it were private property. Although it is the result of their work, code is part of the project and should be freely available to anyone else on the project that needs it. It should be seen by others during reviews and maintenance, even if at no other time.

One of the most successful projects ever reported developed 83,000 lines of code in 11 work-years of effort. Only one error that resulted in system failure was detected in the first 13 months of operation. This accomplishment is even more dramatic when you realize that the project was completed in the late 1960s, without online compilation or interactive debugging. Productivity on the project, 7500 lines of code per work-year in the late 1960s, is still impressive by today’s standards. The chief programmer on the project reported that one key to the project’s success was the identification of all computer runs (erroneous and otherwise) as public rather than private assets (Baker and Mills 1973). This idea  has extended into modern contexts including Extreme Programming’s idea of collective ownership (Beck 2000), as well as in other contexts.

 

Reward good code

 

Use your organization’s reward system to reinforce good coding practices. Keep these considerations in mind as you develop your reinforcement system:  

  • The reward should be something that the programmer wants. (Many programmers find “attaboy” rewards distasteful, especially when they come from nontechnical managers.)
  • Code that receives an award should be exceptionally good. If you give an award to a programmer everyone else knows does bad work, you look like Charlie Chaplin trying to run a cake factory. It doesn’t matter that the programmer has a cooperative attitude or always comes to work on time. You lose credibility if your reward doesn’t match the technical merits of the situation. If you’re not technically skilled enough to make the good-code judgment, don’t! Don’t make the award at all, or let your team choose the recipient.

 

One easy standard

 

If you’re managing a programming project and you have a programming background, an easy and effective technique for eliciting good work is to say “I  must be able to read and understand any code written for the project.” That the manager isn’t the hottest technical hotshot can be an advantage in that it may discourage “clever” or tricky code.

Thursday, November 19, 2009 11:36:40 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   General  | 
  1. Separation of Code from HTML
    To make a clean sweep, with ASP.NET you have the ability to completely separate layout and business logic. This makes it much easier for teams of programmers and designers to collaborate efficiently. This makes it much easier for teams of programmers and designers to collaborate efficiently.
  2. Support for compiled languages
    developer can use VB.NET and access features such as strong typing and object-oriented programming. Using compiled languages also means that ASP.NET pages do not suffer the performance penalties associated with interpreted code. ASP.NET pages are precompiled to byte-code and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the fully compiled code, which is cached until the source changes.
  3. Use services provided by the .NET Framework
    The .NET Framework provides class libraries that can be used by your application. Some of the key classes help you with input/output, access to operating system services, data access, or even debugging. We will go into more detail on some of them in this module.
  4. Graphical Development Environment
    Visual Studio .NET provides a very rich development environment for Web
    developers. You can drag and drop controls and set properties the way you do in Visual Basic 6. And you have full IntelliSense support, not only for your code, but also for HTML and XML.
  5. State management
    To refer to the problems mentioned before, ASP.NET provides solutions for session and application state management. State information can, for example, be kept in memory or stored in a database. It can be shared across Web farms, and state information can be recovered, even if the server fails or the connection breaks down.
  6. Update files while the server is running!
    Components of your application can be updated while the server is online and clients are connected. The Framework will use the new files as soon as they are copied to the application. Removed or old files that are still in use are kept in memory until the clients have finished.
  7. XML-Based Configuration Files
    Configuration settings in ASP.NET are stored in XML files that you can easily read and edit. You can also easily copy these to another server, along with the other files that comprise your application.
Thursday, November 19, 2009 10:27:53 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Wednesday, November 11, 2009

STA (Single Threaded Apartment) is basically the concept that only one thread will interact with your code at a time. Calls into your apartment are marshaled via windows messages (using a non-visible) window. This allows calls to be queued and wait for operations to complete.

MTA (Multi Threaded Apartment) is where many threads can all operate at the same time and the onus is on you as the developer to handle the thread security.

Wednesday, November 11, 2009 4:34:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Interview Question .Net  | 
# Tuesday, October 20, 2009

Process-per-client Architecture.
Multithreaded Architecture.
Hybrid Architecture.

Tuesday, October 20, 2009 7:10:59 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL | SQL Server  | 
# Wednesday, October 07, 2009

A shallow copy creates a new instance of the same type as the original object, and then copies the non-static fields of the original object. If the field is a value type, a bit-by-bit copy of the field is performed. If the field is a reference type, the reference is copied but the referred object is not; therefore, the reference in the original object and the reference in the clone point to the same object.

A deep copy of an object duplicates everything directly or indirectly referenced by the fields in the object

Wednesday, October 07, 2009 7:19:22 AM (GMT Daylight Time, UTC+01:00)  #    Comments [1]   C# | Interview Question .Net  | 
# Sunday, October 04, 2009

First Download IE Web Control from this location.

http://www.asp.net/downloads/archived/ie-web-controls/IEWebControls.exe
 
To build the IE Web Controls:

1.  Make sure you have installed the .NET Framework SDK v1.0 or v1.1
2.  Run Build.bat, which will create a build folder in this directory. 
    The build folder contains Microsoft.Web.UI.WebControls.dll and a
    Runtime directory of supporting files.

To run the IE Web Controls:

1.  Copy the contents of the Runtime directory to the webctrl_client\1_0
    directory under your top-level site directory.  For example, if your
    site root is c:\Inetpub\wwwroot, type this at the command prompt:

    IE Installable Path>xcopy /s /i .\build\Runtime c:\Inetpub\wwwroot\webctrl_client\1_0 /y

    This will create the following directory structure under the site:

      /webctrl_client/1_0
        MultiPage.htc
        TabStrip.htc
        toolbar.htc
        treeview.htc
        webservice.htc
        webserviced.htc
        [images]
        [treeimages]

2.  Create a new web application in IIS and copy the contents of the
    samples directory to this application directory.  For example:

    xcopy /s /i .\samples c:\Inetpub\wwwroot\sampleapp /y

3.  Create a /bin subdirectory for the application and copy the file
    Microsoft.Web.UI.WebControls.dll to this directory.

    The contents of the application will be as follows:

      /sampleapp
        multipage.aspx
        state_city.xml
        tabstrip.aspx
        toolbar.aspx
        treeview.aspx
        treeview_bound.aspx
        /bin
          Microsoft.Web.UI.WebControls.dll

4.  Request the sample pages from your Internet Explorer web browser, for
    example: http://localhost/sampleapp/multipage.aspx
   
For additional documentation and samples visit:
http://msdn.microsoft.com/library/default.asp?url=/workshop/webcontrols/webcontrols_entry.asp

Sunday, October 04, 2009 7:36:15 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 
# Tuesday, September 29, 2009

For Example:

Number Value.....
1          AD
2          GD
2          DE
3          IF
4          OG
4          JD

The output I would like is:-

1         AD
2         GD,DE
3         IF
4         OG,JD

You can also resolve this problem using function.

Create Function Concat( @iNumber int )
RETURNS varchar(500)
AS
BEGIN
 
   DECLARE @List varchar(500)
   SET @List = ''
   Select @List = @List + strValue + ',' from Testing
   Where Number = @iNumber
   RETURN LEFT(@List,LEN(@List)-1)
End

And use this function in SQL Query.

select Number, dbo.Concat(Number) from Testing Group By Number

Tuesday, September 29, 2009 3:46:35 AM (GMT Daylight Time, UTC+01:00)  #    Comments [1]   SQL Server  | 
# Tuesday, August 11, 2009
In case, when you are facing colspan problem in datagarid paging section, then use this code to correcting colspan problem.
 
protected void dGrid_PreRender(object sender, EventArgs e)
        {
            try
            {
                DataGrid dgSidDetails = (DataGrid)sender;
                //Fix for numbering being in a left aligned column
                //For some reason, the ColumnSpan property is ignored andnot rendered
                    //unless set using the Attributes
                    if (dgSidDetails.AllowPaging == true && dgSidDetails.AutoGenerateColumns ==    false)
                    {
                        //Get the Table
                        System.Web.UI.WebControls.Table tab =
                            (System.Web.UI.WebControls.Table)dgSidDetails.Controls[0];
                        //Change the Top Pager
                        if (dgSidDetails.PagerStyle.Position == PagerPosition.Bottom ||
                            dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
                        {
                            tab.Rows[tab.Rows.Count -
                                1].Cells[0].Attributes.Add("colspan",
                                tab.Rows[1].Cells.Count.ToString());
                        }
                        //Change the Bottom Pager
                        if (dgSidDetails.PagerStyle.Position == PagerPosition.Top ||
                            dgSidDetails.PagerStyle.Position == PagerPosition.TopAndBottom)
                        {
                            tab.Rows[0].Cells[0].Attributes.Add("colspan",
                                tab.Rows[1].Cells.Count.ToString());
                        }
                    }
            }
            catch (Exception ex)
            {

            }
        }
Tuesday, August 11, 2009 12:29:41 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ASP.NET  | 
# Friday, August 07, 2009
SELECT COUNT(*) AS Total FROM syscolumns WHERE (name = 'clientID')
Friday, August 07, 2009 12:34:54 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
# Thursday, August 06, 2009

'Count': Counts the number of non-null values.


'Count (*)': Counts the number of rows in the table, including null values and duplicates.

Thursday, August 06, 2009 12:33:31 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
You can create local and global temporary tables. Local temporary tables are visible only in the current session; global temporary tables are visible to all sessions. Prefix local temporary table names with single number sign (# table_name), and prefix global temporary table names with a double number sign (##table_name).
Thursday, August 06, 2009 12:32:53 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

Views or tables participating in a view created with the SCHEMABINDING clause cannot be dropped. If the view is not created using SCHEMABINDING, then we can drop the table.

Thursday, August 06, 2009 12:31:58 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

Stored procedures are nested when one stored procedure calls another. You can nest stored procedures up to 32 levels.

Thursday, August 06, 2009 12:31:01 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
# Wednesday, August 05, 2009
Maharshi Dayanand Saraswati University (MDS) Rohtak, online counseling for B.Ed course from  5th August - 17th August 2009 on http://www.hrybedcounselling2009.nic.in/

From 16th August - 19th August 2009, the candidates can download their admission letters and report at the respective allotted colleges for verification of documents and depositing the fees.

MDU Rohtak B.Ed Counselling details are available on MDU Rohtak Website -

http://mdurohtak.com/

Direct Link to MDU Rohtak B.Ed Counselling Details -

http://mdurohtak.com/Site/Details.aspx?pid=H&id=12
Wednesday, August 05, 2009 5:39:02 AM (GMT Daylight Time, UTC+01:00)  #    Comments [2]   General  | 
# Wednesday, July 15, 2009

• The sp_recompile system stored procedure forces a recompile of a stored procedure the next time it is run.

• Creating a stored procedure that specifies the WITH RECOMPILE option in its definition indicates that SQL Server does not cache a plan for this stored procedure; the stored procedure is recompiled each time it is executed. Use the WITH RECOMPILE option when stored procedures take parameters whose values differ widely between executions of the stored procedure, resulting in different execution plans to be created each time. Use of this option is uncommon, and causes the stored procedure to execute more slowly because the stored procedure must be recompiled each time it is executed.

• You can force the stored procedure to be recompiled by specifying the WITH RECOMPILE option when you execute the stored procedure. Use this option only if the parameter you are supplying is atypical or if the data has significantly changed since the stored procedure was created.

Wednesday, July 15, 2009 2:04:06 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

You can use the sp_procoption system stored procedure in master database to mark the stored procedure to automatic execution when the SQL Server will start.

Wednesday, July 15, 2009 2:03:04 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

There are four different type of stored procedure given below:

1. Temporary Stored Procedures - SQL Server supports two types of temporary procedures: local and global. A local temporary procedure is visible only to the connection that created it. A global temporary procedure is available to all connections. Local temporary procedures are automatically dropped at the end of the current session. Global temporary procedures are dropped at the end of the last session using the procedure. Usually, this is when the session that created the procedure ends. Temporary procedures named with # and ## can be created by any user.

2. System stored procedures are created and stored in the master database and have the sp_ prefix.(or xp_) System stored procedures can be executed from any database without having to qualify the stored procedure name fully using the database name master. (If any user-created stored procedure has the same name as a system stored procedure, the user-created stored procedure will never be executed.)

3. Automatically Executing Stored Procedures - One or more stored procedures can execute automatically when SQL Server starts. The stored procedures must be created by the system administrator and executed under the sysadmin fixed server role as a background process. The procedure(s) cannot have any input parameters.

4. User defined stored procedure - These stored procedure is created by user.

Wednesday, July 15, 2009 2:02:16 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
# Monday, July 13, 2009

Microsoft® SQL Server™ 2000 uses locking to ensure transactional integrity and database consistency. Locking prevents users from reading data being changed by other users, and prevents multiple users from changing the same data at the same time. If locking is not used, data within the database may become logically incorrect, and queries executed against that data may produce unexpected results.
Lock mode Description. There are six different type of locks given below:

Shared (S) Used for operations that do not change or update data (read-only operations), such as a SELECT statement.
Update (U) Used on resources that can be updated. Prevents a common form of deadlock that occurs when multiple sessions are reading, locking, and potentially updating resources later.
Exclusive (X) Used for data-modification operations, such as INSERT, UPDATE, or DELETE. Ensures that multiple updates cannot be made to the same resource at the same time.
Intent Used to establish a lock hierarchy. The types of intent locks are: intent shared (IS), intent exclusive (IX), and shared with intent exclusive (SIX).
Schema Used when an operation dependent on the schema of a table is executing. The types of schema locks are: schema modification (Sch-M) and schema stability (Sch-S).
Bulk Update (BU) Used when bulk-copying data into a table and the TABLOCK hint is specified.

Monday, July 13, 2009 2:06:07 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

Views can have only select statements (create, update, truncate, delete statements are not allowed) Views cannot have "select into", "Group by" "Having", "Order by"

Monday, July 13, 2009 2:04:56 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
# Thursday, July 09, 2009
SELECT MIN(Salary) AS Expr1 FROM tblEmployee 
WHERE (empid IN (SELECT DISTINCT TOP 5 empid FROM tblSalary ORDER BY Salary))  
Thursday, July 09, 2009 7:27:51 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

ASP.NET provides the following additional benefits:

Simplified development: ASP.NET offers a very rich object model that developers can use to reduce the amount of code they need to write.

Language independence: ASP pages must be written with scripting. In other words, ASP pages must be written in a language that is interpreted rather than compiled. ASP.NET allows compiled languages to be used, providing better performance and cross-language compatibility.

Simplified deployment: With .NET components, deployment is as easy as copying a component assembly to its desired location.

Cross-client capability: One of the foremost problems facing developers today is writing code that can be rendered correctly on multiple client types. For example, writing one script that will render correctly in Internet Explorer 5.5 and Netscape Navigator 4.7, and on a PDA and a mobile phone is very difficult, if not impossible, and time consuming. ASP.NET provides rich server-side components that can automatically produce output specifically targeted at each type of client.

Web services: ASP.NET provides features that allow ASP.NET developers to effortlessly create Web services that can be consumed by any client that understands HTTP and XML, the de facto language for inter-device communication.

Performance: ASP.NET pages are compiled whereas ASP pages are interpreted. When an ASP.NET page is first requested, it is compiled and cached, or saved in memory, by the .NET Common Language Runtime (CLR). This cached copy can then be re-used for each subsequent request for the page. Performance is thereby improved because after the first request, the code can run from a much faster compiled version.

Thursday, July 09, 2009 7:19:56 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ASP.NET  | 


1. Use views and stored procedures instead of heavy-duty queries.
This can reduce network traffic, because your client will send to server only stored procedure or view name (perhaps with some parameters) instead of large heavy-duty queries text. This can be used to facilitate permission management also, because you can restrict user access to table columns they should not see.

2. Try to use constraints instead of triggers, whenever possible.
Constraints are much more efficient than triggers and can boost performance. So, you should use constraints instead of triggers, whenever possible.

3. Use table variables instead of temporary tables.
Table variables require less locking and logging resources than temporary tables, so table variables should be used whenever possible. The table variables are available in SQL Server 2000 only.

4. Try to use UNION ALL statement instead of UNION, whenever possible.
The UNION ALL statement is much faster than UNION, because UNION ALL statement does not look for duplicate rows, and UNION statement does look for duplicate rows, whether or not they exist.

5. Try to avoid using the DISTINCT clause, whenever possible.
Because using the DISTINCT clause will result in some performance degradation, you should use this clause only when it is necessary.

6. Try to avoid using SQL Server cursors, whenever possible.
SQL Server cursors can result in some performance degradation in comparison with select statements. Try to use correlated sub-query or derived tables, if you need to perform row-by-row operations.

7. Try to avoid the HAVING clause, whenever possible.
The HAVING clause is used to restrict the result set returned by the GROUP BY clause. When you use GROUP BY with the HAVING clause, the GROUP BY clause divides the rows into sets of grouped rows and aggregates their values, and then the HAVING clause eliminates undesired aggregated groups. In many cases, you can write your select statement so, that it will contain only WHERE and GROUP BY clauses without HAVING clause. This can improve the performance of your query.

8. If you need to return the total table's row count, you can use alternative way instead of SELECT COUNT(*) statement.
Because SELECT COUNT(*) statement make a full table scan to return the total table's row count, it can take very many time for the large table. There is another way to determine the total row count in a table. You can use sysindexes system table, in this case. There is ROWS column in the sysindexes table. This column contains the total row count for each table in your database. So, you can use the following select statement instead of SELECT COUNT(*): SELECT rows FROM sysindexes WHERE id = OBJECT_ID('table_name') AND indid < 2 So, you can improve the speed of such queries in several times.

9. Include SET NOCOUNT ON statement into your stored procedures to stop the message indicating the number of rows affected by a T-SQL statement.
This can reduce network traffic, because your client will not receive the message indicating the number of rows affected by a T-SQL statement.

10. Try to restrict the queries result set by using the WHERE clause.
This can results in good performance benefits, because SQL Server will return to client only particular rows, not all rows from the table(s). This can reduce network traffic and boost the overall performance of the query.

11. Use the select statements with TOP keyword or the SET ROWCOUNT statement, if you need to return only the first n rows.
This can improve performance of your queries, because the smaller result set will be returned. This can also reduce the traffic between the server and the clients.

12. Try to restrict the queries result set by returning only the particular columns from the table, not all table's columns.
This can results in good performance benefits, because SQL Server will return to client only particular columns, not all table's columns. This can reduce network traffic and boost the overall performance of the query. 
  
Index Optimization Tips.

• Every index increases the time in takes to perform INSERTS, UPDATES and DELETES, so the number of indexes should not be very much. Try to use maximum 4-5 indexes on one table, not more. If you have read-only table, then the number of indexes may be increased.

• Keep your indexes as narrow as possible. This reduces the size of the index and reduces the number of reads required to read the index.

• Try to create indexes on columns that have integer values rather than character values.

• If you create a composite (multi-column) index, the order of the columns in the key are very important. Try to order the columns in the key as to enhance selectivity, with the most selective columns to the leftmost of the key.

• If you want to join several tables, try to create surrogate integer keys for this purpose and create indexes on their columns.

• Create surrogate integer primary key (identity for example) if your table will not have many insert operations.

• Clustered indexes are more preferable than nonclustered, if you need to select by a range of values or you need to sort results set with GROUP BY or ORDER BY.
 

Thursday, July 09, 2009 7:17:55 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SQL Server  | 
# Wednesday, July 08, 2009

A stored procedure is a set of Structured Query Language (SQL) statements that you assign a name to and store in a database in compiled form so that you can share it between a number of programs.
• They allow modular programming.
• They allow faster execution.
• They can reduce network traffic.
• They can be used as a security mechanism.

Wednesday, July 08, 2009 7:53:35 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

Yes, Let us consider there is employ Table ( empid, empName, empManagerid). In this table manager is also be an employ.

Wednesday, July 08, 2009 7:52:09 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 

Only one value can be returned from method, however you can use ref or out variable to change more than one value in called method.

Wednesday, July 08, 2009 7:51:24 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question C#  | 

A try statement have zero or more catch statement, There is no limit to the number of catch statement.

Wednesday, July 08, 2009 7:49:24 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question C#  | 

The primary difference is that a structure is value data type and class is the reference data type.

Structure don't have default constructur or destructors.

In Structure all variable and method is public where as in class it is private by default.

Structure does not have inherit

Wednesday, July 08, 2009 7:46:06 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question C#  | 

It define a set of feature that all .net compatible languages should support.

Wednesday, July 08, 2009 7:41:02 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question .Net  | 

Single line, multiple line and document line.

Single line start form anywhere on a line with two forward slashs (//).

Multiple comment start with forward slash followed by an asterisk (/*) and end with asterisk followed by slash .

Document comment start with three forward slashes(///).

Wednesday, July 08, 2009 7:39:34 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question C#  | 

Difference Between DELETE & TRUNCATE Are

1. DELETE  is a DML Command & TRUNCATE is a DDL Command

2. After DELETE  can rollback the Records & After TRUNATE cannot rollback the records

3. In DELETE Command you can give the conditions in WHERE Clause & In TRUNCATE you cannot give conditions

4. After using DELETE Command The memory will be occupied till the user does not give ROLLBACK or COMMIT & After using TRUNCATE Command The memory realeased immediately

Wednesday, July 08, 2009 7:36:57 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
foreach ( objectcontrol in form1)
{ 
   if ( typeof Objectcontrol is TextBox)
   {

      Objectcontrol.text = "";
   }
   elseif ( typeof objectcontrol is checkbox)    {       objectcontorl.checked = false;    } }
Wednesday, July 08, 2009 7:30:50 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question C#  | 

LEFT OUTER JOIN - This returns all the matching rows and the unmatched rows of the left table of the SQL code.

RIGHT OUTER JOIN - This returns all the matching rows and the unmatched rows of the right table of the SQL.

FULL OUTER JOIN - This returns all the matching and unmatched rows from both the tables.

Wednesday, July 08, 2009 7:28:53 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question SQL  | 
//Create Two image Server path    
string strImagePath1 = Server.MapPath("Image1.jpg");
string strImagePath2 = Server.MapPath("Image2.jpg");
//Get Image objct
System.Drawing.Image FirstImage = Bitmap.FromFile(strImagePath1);
Graphics objGraphics = Graphics.FromImage(FirstImage);
System.Drawing.Image SecondImage = Bitmap.FromFile(strImagePath2);

int iFirstImageWidth, iFirstImageHeight, iSecondImageWidth, iSecondImageHeight;
int xPos, yPos;
//Retrieve the Height and Width of Images
iFirstImageWidth = FirstImage.Width;
iFirstImageHeight= FirstImage.Height;
iSecondImageWidth = SecondImage.Width;
iSecondImageHeight = SecondImage.Height;
//Retrieving the position where to image merge    
xPos = (iFirstImageWidth - iSecondImageWidth) / 2;
yPos = (iFirstImageHeight - iSecondImageHeight) / 2;
//Draw Second Image into First Image
objGraphics.DrawImage(SecondImage, new Point(xPos, yPos));

Response.ContentType = "image/JPEG";
//Save the Merge Image
FirstImage.Save(Server.MapPath("MergeImage.jpg"), ImageFormat.Jpeg);
Wednesday, July 08, 2009 6:43:01 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C#  | 
# Tuesday, July 07, 2009

Caching is the technique of storing an in-memory copy of some information that’s expensive to create. For example, you could cache the results of a complex query so that subsequent requests don’t need to access the database at all. Instead, they can grab the appropriate object directly from server memory—a much faster proposition. The real beauty of caching is that unlike many other performance-enhancing techniques, caching bolsters both performance and scalability.


Output caching: This is the simplest type of caching. It stores a copy of the final rendered HTML page that is sent to the client. The next client that submits a request for this page doesn’t actually run the page. Instead, the final HTML output is sent automatically. The time that would have been required to run the page and its code is completely reclaimed.

Data caching: This type of caching is carried out manually in your code. To use data caching, you store important pieces of information that are time-consuming to reconstruct (such as a DataSet retrieved from a database) in the cache. Other pages can check for the existence of this information and use it, thereby bypassing the steps ordinarily required to retrieve it.

Fragment caching: This is a specialized type of output caching—instead of caching the HTML for the whole page, it allows you to cache the HTML for a portion of it. Fragment caching works by storing the rendered HTML output of a user control on a page. The next time the page is executed, the same page events fire (and so your page code will still run), but the code for the appropriate user control isn’t executed.

Data source caching: This is the caching that’s built into the data source controls, including the SqlDataSource, ObjectDataSource, and XmlDataSource. Technically, data source caching uses data caching. The difference is that you don’t need to handle the process explicitly.
Instead, you simply configure the appropriate properties, and the data source control manages the caching storage and retrieval.

Tuesday, July 07, 2009 7:08:32 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 
# Friday, July 03, 2009

When we roll back our transaction, it nullifies the effect of every command you’ve executed since you started the last transaction. But what happens if you want to roll back only part of an ongoing transaction? SQL Server handles this with a feature called savepoints.

Savepoints are markers that act like bookmarks. You mark a certain point in the flow of the transaction, and then you can roll back to that point. You set the savepoint using the Transaction.Save() method.

Here’s a conceptual look at how you use a savepoint:

// Start the transaction.
SqlTransaction trans = Connection.BeginTransaction();
// Mark a savepoint.
trans.Save("CompletedUpdate");
// If needed, roll back to the savepoint.
trans.Rollback("CompletedUpdate");
// Commit or roll back the transaction.
trans.Commit();
Friday, July 03, 2009 12:35:56 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ADO.NET  | 

ExecuteNonQuery() Executes non-SELECT commands, such as SQL commands that insert, delete, or update records. The returned value indicates the number of rows affected by the command. You can also use ExecuteNonQuery() to execute data-definition commands that create, alter, or delete database objects (such as tables, indexes, constraints, and so on).

ExecuteScalar() Executes a SELECT query and returns the value of the first field of the first row from the rowset generated by the command. This method is usually used when executing an aggregate SELECT command that uses functions such as COUNT() or SUM() to calculate a single value.

ExecuteReader() Executes a SELECT query and returns a DataReader object that wraps a read-only, forward-only cursor.

Friday, July 03, 2009 12:14:25 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ADO.NET  | 
# Thursday, July 02, 2009

A data provider is a set of ADO.NET classes that allows you to access a specific database, execute SQL commands, and retrieve data. Essentially, a data provider is a bridge between your application and a data source.

There are four type of providers in .net:

SQL Server provider: Provides optimized access to a SQL Server database (version 7.0 or later).

OLE DB provider: Provides access to any data source that has an OLE DB driver. This includes SQL Server databases prior to version 7.0.

Oracle provider: Provides optimized access to an Oracle database (version 8i or later).

ODBC provider: Provides access to any data source that has an ODBC driver.

Thursday, July 02, 2009 12:02:02 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ADO.NET  | 

ADO.NET has two types of objects: connection-based and content-based.

Connection-based objects: These are the data provider objects such as Connection, Command, DataReader, and DataAdapter. They allow you to connect to a database, execute SQL statements, move through a read-only result set, and fill a DataSet. The connection-based objects are specific to the type of data source, and are found in a provider-specific namespace (such as System.Data.SqlClient for the SQL Server provider).

Content-based objects: These objects are really just "packages" for data. They include the DataSet, DataColumn, DataRow, DataRelation, and several others. They are completely independent of the type of data source and are found in the System.Data namespace.

Thursday, July 02, 2009 11:58:47 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ADO.NET  | 
# Wednesday, July 01, 2009

There are three type of CommandType enumeration in ADO.NET.

CommandType.Text The command will execute a direct SQL statement. The SQL statement is provided in the CommandText property. This is the default value.

CommandType.StoredProcedure The command will execute a stored procedure in the data source. The CommandText property provides the name of the stored procedure.

CommandType.TableDirect The command will query all the records in the table. The CommandText is the name of the table from which the command will retrieve the records.

Wednesday, July 01, 2009 12:10:36 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Interview Question ADO.NET  | 
# Monday, June 29, 2009
In ASP.NET 2.0, managing controls has become easier. Instead of declaring them on every page, you can declare them only once in your web.config file and use them in your entire project.
<configuration>
    <system.web>       
      <pages>
            <controls>
                  <add tagPrefix="portal" tagName="Top"src="~/Controls/Top.ascx" />
            </controls >
      </pages >  
    </system.web>
</configuration>
Once you have registered this control in your web.config, you can use this control on any page without explicitly adding a register directive on the page.
<body>
    <form id="form1" runat="server">
    <div>
        <portal:Top ID="Top1" runat="server" />
    </div>
    </form>
</body>
 
Monday, June 29, 2009 10:03:00 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 
# Friday, June 26, 2009

One difference is that web forms start with the Page directive, a master page starts with a Master directive that specifies the same information, as shown here:

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="SiteTemplate.master.cs" Inherits="SiteTemplate" %>

Another difference between master pages and ordinary web forms is that master pages can use the ContentPlaceHolder control, which isn’t allowed in ordinary pages. The ContentPlaceHolder is a portion of the page where the content page can insert content.

Friday, June 26, 2009 12:47:09 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 
# Wednesday, June 24, 2009

Every .aspx page starts with a Page directive. This Page directive specifies the language for the page,
and it also tells ASP.NET where to find the associated code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="FileName.aspx.cs" Inherits="FileName"%>

Notice that Visual Studio uses a slightly unusual naming syntax for the source code file. It has
the full name of the corresponding web page, complete with the .aspx extension, followed by the .cs
extension at the end.

Wednesday, June 24, 2009 12:40:20 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 

The latest version of Visual Studio has some long-awaited improvements. They include the following:

Web projects: Visual Studio 2005 replaced the traditional project-based web application model with a lighterweight system of projectless development. However, this change didn’t please everyone, and so Microsoft released an add-on that brought the web project option back. In Visual Studio 2008, developers get the best of both worlds, and can choose to create projectless or project-based web applications depending on their needs.

Multitargeting: Web servers won’t shift overnight from .NET 2.0 to .NET 3.5. With this in mind, Visual Studio now gives you the flexibility to develop applications that target any version of the .NET Framework, from version 2.0 on.

CSS: In order to apply consistent formatting over an entire website, developers often use the Cascading Style Sheets (CSS) standard. Now Visual Studio makes it even easier to link web pages to stylesheets, and pick and choose the styles you want to apply to various elements in your page without editing the markup by hand.

Wednesday, June 24, 2009 12:05:21 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   .Net  | 

LINQ and Ajax are the two new features introduced in ASP.NET 3.5

LINQ
-----
LINQ (Language Integrated Query) is a set of extensions for the C# and Visual Basic languages. It allows you to write C# or Visual Basic code that manipulates in-memory data in much the same way you query a database.

Technically, LINQ defines about 40 query operators, such as select, from, in, where, and orderby (in C#). These operators allow you to code your query. However, there are various types of data on which this query can be performed, and each type of data requires a separate flavor  of LINQ.

AJAX
-----
Ajax(Asynchronous JavaScript and XML)is programming shorthand for a client-side technique that allows your page to call the server and update its content without triggering a complete postback. Typically, an Ajax page uses client-side script code to fire an asynchronous request behind the scenes. The server receives this request, runs some code, and then returns the data your page needs (often as a block of XML markup). Finally, the client-side code receives the new data and uses it to perform another action, such as refreshing part of the page.

Green Bits and Red Bits
-------------------------
Oddly enough, ASP.NET 3.5 doesn’t include a full new version of ASP.NET. Instead, ASP.NET 3.5 is designed as a set of features that add on to .NET 2.0. The parts of .NET that haven’t changed in .NET 3.5 are often referred to as red bits, while the parts that have changed are called green bits. The red bits include the CLR, the ASP.NET engine, and all the class libraries from .NET 2.0. In
other words, if you build a new ASP.NET 3.5 application, it gets exactly the same runtime environment as an ASP.NET 2.0 application. Additionally, all the classes you used in .NET 2.0—including those for connecting to a database, reading and writing files, using web controls, and so on—remain the same in .NET 3.5. The red bits also include the features that were included in .NET 3.0, such as WCF. All the assemblies in .NET 3.5 retain their original version numbers. That means .NET 3.5 includes a mix of 2.0, 3.0, and 3.5 assemblies. If you’re curious when an assembly was released, you simply need to check the version number.

The ASP.NET 3.5 green bits consist of a small set of assemblies with new types. For ASP.NET developers, the important new assemblies include the following:

• System.Core.dll: Includes the core LINQ functionality
• System.Data.Linq.dll: Includes the implementation for LINQ to SQL
• System.Data.DataSetExtensions.dll:. Includes the implementation for LINQ to DataSet
• System.Xml.Linq.dll: Includes the implementation for LINQ to XML
• System.Web.Extensions.dll: Includes the implementation for ASP.NET AJAX and new web controls


Silverlight
-----------
Recently, there’s been a lot of excitement about Silverlight, a new Microsoft technology that allows a variety of browsers on a variety of operating systems to run true .NET code. Silverlight works through a browser plug-in, and provides a subset of the .NET Framework class library. This subset includes a slimmed-down version of WPF, the technology that developers use to craft next-generation Windows user interfaces.

Silverlight is all about client code—quite simply, it allows you to create richer pages than you could with HTML, DHTML, and JavaScript alone. In many ways, Silverlight duplicates the features and echoes the goals of Adobe Flash. By using Silverlight in a web page, you can draw sophisticated 2D graphics, animate a scene, and play video and other media files.

Wednesday, June 24, 2009 11:24:55 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 

There are Four type of symmetric encryption algorithms in .net.

DES 

The Data Encryption Standard (DES) was developed by an IBM team around 1974 and adopted as a national standard in 1977. DES encrypts and decrypts data in 64-bit blocks, using a 64-bit key. Although the input key for DES is 64 bits long, the actual key used by DES is only 56 bits in length. The least significant (right-most) bit in each byte is a parity bit, and should be set so that there are always an odd number of 1s in every byte. These parity bits are ignored, so only the seven most significant bits of each byte are used, resulting in a key length of 56 bits. 

Triple DES 

Triple DES is three times slower than regular DES but can be billions of times more secure if used properly. Triple DES is simply another mode of DES operation. It takes three 64-bit keys, for an overall key length of 192 bits. The procedure for encryption is exactly the same as regular DES, but it is repeated three times, hence the name Triple DES. The data is encrypted with the first key, encrypted with the second key, and finally encrypted again with the third key. Triple DES enjoys much wider use than DES because DES is so easy to break with today's rapidly advancing technology. 

RC2

RC2 (Rivest Cipher) was designed by Ron Rivest as a replacement for DES and boasts a 3 times speed increase over DES. The input and output block sizes are 64 bits each. The key size is variable, from one byte up to 128 bytes, although the current implementation uses eight bytes. The algorithm is designed to be easy to implement on 16-bit microprocessors.

Rijndael

The National Institute of Standards and Technology (NIST) officially announced that Rijndael, designed by Joan Daemen and Vincent Rijmen, would be the new Advanced Encryption Standard.

The Advanced Encryption Standard (AES) is the current encryption standard, intended to be used by  the U.S. Government organisations to protect sensitive (and even secret and top secret) information. It is also becoming a global standard for commercial software and hardware that use encryption. It is a block cipher which uses 128-bit, 192-bit or 256-bit keys. Rijndael is very secure and has no known weaknesses.

Wednesday, June 24, 2009 11:10:15 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   .Net  | 

Some of the differences between ASP.NET and ASP include the following:

• ASP.NET features a completely object-oriented programming model, which includes an event driven,
control-based architecture that encourages code encapsulation and code reuse.

• ASP.NET gives you the ability to code in any supported .NET language (including VisualBasic, C#, J#,
and many other languages that have third-party compilers).

• ASP.NET is dedicated to high performance. ASP.NET pages and components are compiled ondemand
instead of being interpreted every time they’re used. ASP.NET also includes a finetuned
data access
model and flexible data caching to further boost performance.

Wednesday, June 24, 2009 10:46:33 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 
# Tuesday, June 23, 2009


Java of AES Encryption
=======================
            Cipher encrypt = Cipher.getInstance("AES");
            encrypt.init(Cipher.ENCRYPT_MODE, key);
            byte[] encryptedData = encrypt.doFinal(data);

C# code using Rijndael(AES) 128 Bit encryption
==============================================

 

       ICryptoTransform transform = GetCryptoServiceProvider(SecretKey);

       //Set up the stream that will hold the encrypted data.
       MemoryStream memStreamEncryptedData = GetMemoryStream(transform, bytesData);

        /// <summary>
        /// Create ICryptoTransform object from Rijndael(AES) ECB/PKCS7
        /// </summary>
        /// <param name="bytesKey">Byte Array key</param>
        /// <returns>ICryptoTransform Object</returns>
        private ICryptoTransform GetCryptoServiceProvider(byte[] bytesKey)
        {
            Rijndael rijndael = new RijndaelManaged();
            try
            {
                rijndael.KeySize = 128;
                rijndael.BlockSize = 128;
                rijndael.Mode = CipherMode.ECB;
                rijndael.Padding = PaddingMode.PKCS7;
                // Test to see if a key was provided
                rijndael.GenerateIV();

                if (null != bytesKey)
                {
                    rijndael.Key = bytesKey;
                }
                else
                {
                    rijndael.GenerateKey();
                    SecretKey = rijndael.Key;
                }
            }
            catch (Exception Ex)
            {
                throw new Exception("Error while creating Rijndael(AEs) Object: \n" + Ex.Message);
            }

            return rijndael.CreateEncryptor();

        }

Tuesday, June 23, 2009 12:18:19 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C#  | 

Java code for retrieve Public key from Certificate
==================================================
 
     KeyStore inputKeyStore = KeyStore.getInstance(Constents.PFX_TYPE);
            FileInputStream fis = new FileInputStream(keyStoreFile);
            char[] nPassword = password.toCharArray();
            inputKeyStore.load(fis, nPassword);
            Enumeration enumeration = inputKeyStore.aliases();
            String keyAlias = null;
            while (enumeration.hasMoreElements()) {
                keyAlias = (String) enumeration.nextElement();
            }
            X509Certificate certificate = (X509Certificate) inputKeyStore
                    .getCertificate(keyAlias);           
            publicKey = certificate.getPublicKey(); 

And Encrypt Code using Public Key of certificate.
=================================================

            Cipher cipher = Cipher.getInstance(xform); //xform:RSA/ECB/PKCS1Padding
            cipher.init(Cipher.ENCRYPT_MODE, publicKey );         
            return cipher.doFinal(Data.getEncoded());


C# compatible Code
===================

Include Namespace of Bouncy Castle Dll.

This DLL is freely available from this link http://www.bouncycastle.org/csharp/

using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.X509;
using Org.BouncyCastle.Crypto.Encodings;
using Org.BouncyCastle.Crypto.Engines;

 

               //Create file stream object to read certificate
                FileStream keyStream = new FileStream(strCertificatePath, FileMode.Open, FileAccess.Read);

                //Read certificate using BouncyCastle component
                Pkcs12Store inputKeyStore = new Pkcs12Store(keyStream, strCertificatePassword.ToCharArray());
                
                //Close File stream
                keyStream.Close();

                string keyAlias = null;

                //Read Key from Alieases  
                foreach (string n in inputKeyStore.Aliases)
                {
                    if (inputKeyStore.IsKeyEntry(n))
                    {
                        keyAlias = n;
                        break;
                    }
                }

                if (keyAlias == null)
                    throw new NotImplementedException("Alias");

                //Read certificate into 509 format
                X509Certificate certificate = (X509Certificate)inputKeyStore.GetCertificate(keyAlias).Certificate;

                //Retrieve public key of certificate
                AsymmetricKeyParameter publicKey = certificate.GetPublicKey();
                #endregion

                 //Encrypting (aesKey is a byte array containing an AES key): RSA/ECB/PKCS1Padding
                IAsymmetricBlockCipher cipher = new Pkcs1Encoding(new RsaEngine());
                cipher.Init(true, publicKey);
                byte[] encodedKey = cipher.ProcessBlock(SecretKey, 0, SecretKey.Length);
Tuesday, June 23, 2009 12:10:47 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C#  | 

First add vjslib.dll from add reference link. Through this dll, we can compress data compatible with Java Compression.

Add Namespace into your class

using java.util.zip;
using java.util;
using java.io;

 

        /// <summary>
        /// This function is used to compress byte array data using java util.
        /// </summary>
        /// <param name="data">Byte Array Data</param>
        /// <param name="path">Path to Store compress File</param>
        /// <param name="fileName">File Name</param>
        public static void compressFileWrite(byte[] data, String path, String fileName)
        {

            try
            {
                java.io.File folder = new java.io.File(path + FORWARD_SLASH + ENCRYPT_OUTPUT_PATH);
                if (!folder.isDirectory())
                {
                    folder.mkdir();
                }
                java.io.File file = new java.io.File(folder.getPath() + FORWARD_SLASH + fileName);
                FileOutputStream fos = new FileOutputStream(file);
                DeflaterOutputStream dos = new DeflaterOutputStream(fos);
                dos.write((sbyte[])(Array)data);
                dos.close();
            }
            catch (java.io.FileNotFoundException Ex)
            {
                throw new Exception("Error while reading file \n" + Ex.Message);
            }
            catch (java.io.IOException Ex)
            {
                throw new Exception("Error in Compress File \n" + Ex.Message);
            }

        }

 This above code is compatible with java compression

Tuesday, June 23, 2009 11:49:36 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C#  | 
# Monday, June 22, 2009
      Microsoft .net framework provide a facility for sending mail using System.Web.Mail(SMTP)
      First include this using System.Web.Mail in your code, For sending mail we are creating a function sendMail,
      it is used for sending email. For correctly running
      this code, please find register two dll "cdonts.dll" and "cdosys.dll".
      These two dll is microsoft dll used for sending mail.
 
      public void sendMail()
        { 

            try 

            {  

                //Provides properties and methods for sending messages using the Collaboration Data Objects for 
                  Windows 2000 (CDOSYS) message component.
                SmtpMail.SmtpServer= "SMTP Server IP Address";                 MailMessage msg = new MailMessage();                 // Specify the e-mail sender.                 msg.From = "rajshekhar@mail.com";//Self mail address // Set destinations for the e-mail message.                 msg.To = "Send Email Address";                 // Set destinations of Carbon Copy(CC) for the e-mail message.                 msg.Cc = "CC Email Address;                 // Set destinations of Blind carbon copies(BCC) for the e-mail message.                 msg.Bcc = "BCC Email Address";                 // Specify the message subject.                 msg.Subject = this.txtSubject.Text;                 // Specify the message content.                 msg.Body = "Content of Message Assign Here";                 msg.BodyFormat = MailFormat.Text;                 //The username for authenticating to an SMTP server using basic (clear-text) authentication.                 msg.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendusername",
                                 "itq@vmaildeliver.vsnl.com");
                //The password used to authenticate to an SMTP server using basic (clear-text) authentication.                 msg.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/sendpassword","itq.1.123");                 /%                         Specifies the authentication mechanism to use when authentication is required to send messages
                to an SMTP service using a TCP/IP network socket.                                                          The Secound parameter in smtpauthenticateis CdoProtocolsAuthentication enumeration, It is
                used to specify the mechanism used when authenticating to a Simple Mail Transfer Protocol(SMTP)
                service over the network.                 It has three different type of value:                 Name            Value                Description                 ====            =====                ============                 cdoAnonymous     0                 Do not authenticate.                                  cdoBasic         1                 Use basic (clear-text) authentication. The configuration
                                                   sendusername/sendpassword or postusername/postpassword fields
                                                  are used to specify credentials.                                  cdoNTLM             2              Use NTLM authentication (Secure Password Authentication in
                                                   Microsoft® Outlook® Express).The current process security
                                                   context is used to authenticate with the service.                                  */                                             msg.Fields.Add( "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",1);                 //Sending Message                             SmtpMail.Send(msg);                              }             catch (Exception ex)             {                 ErrorMessage("Send Mail Process was failed!!!");                              }             finally             {                                  SuccessMessage("Send Mail Process was successfull!!!");             }         }

You can use this above code for sending mail using SMTP in ASP.NET.

Monday, June 22, 2009 11:26:30 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   .Net | asp.net  | 
# Sunday, June 21, 2009

In SQL Server 2000,


sp_lock is used to find dead lock inside the database.
if any dead lock occur then using "Kill spid" is to remove the dead lock.

Sunday, June 21, 2009 11:39:11 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SQL Server  | 
private void Page_Load(object sender, System.EventArgs e)
        {
            DataSet objds        = null;
            OleDbConnection conn = null;
            try
            {            
                if (File.Exists(Server.MapPath("UploadedFare/UploadedFare.xls").Trim()))
                {
                    gblConnSting = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath
                     ("UploadedFare/UploadedFare.xls").Trim() + ";Extended Properties=\"Excel 8.0;HDR=YES;\"";                     conn    = new OleDbConnection(gblConnSting);;                                                          conn.Open();                     objds = new DataSet();                     OleDbDataAdapter objAdp    = new OleDbDataAdapter("select * from [Sheet1$] where
                                                                     [Airline] <> '' OR [Airline] <> null"
,conn);                     objAdp.AcceptChangesDuringFill = false;                     objAdp.Fill(objds);                             dgExcelData.DataSource    = objds.Tables[0].DefaultView;                     dgExcelData.DataBind();                 }                 else                     Response.Write("<B>No Fare Is Uploaded !</B>");             }             catch(Exception ex)             {                 new clsErrorLogging(ex);             }                     finally             {                 dgExcelData.Dispose();                 objds.Dispose();                 conn.Dispose();             }         }
 
Datagrid

       <asp:datagrid id="dgExcelData" runat="server" HeaderStyle-Wrap="False" BorderColor="LightGray"
        BorderWidth="1px">
        <ItemStyle Font-Size="X-Small" Wrap="False"></ItemStyle>
        <HeaderStyle Font-Size="Smaller" Font-Names="Verdana" Font-Bold="True" Wrap="False" HorizontalAlign="Center"
         ForeColor="Black" VerticalAlign="Middle" CssClass="tableheadergrey2" BackColor="Gainsboro" ></HeaderStyle>
       </asp:datagrid>
Sunday, June 21, 2009 11:37:58 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net | C#  | 

HTTP Channel
The HTTP channel transports messages to and from remote objects using the SOAP protocol. All messages are passed through the SOAP formatter, where the message is changed into XML and serialized, and the required SOAP headers are added to the stream. It is also possible to configure the HTTP Channel to use the binary formatter. The resulting data stream is then transported to the target URI using the HTTP protocol.


TCP Channel
The TCP channel uses a binary formatter to serialize all messages to a binary stream and transport the stream to the target URI using the TCP protocol. It is also possible to configure the TCP channel to the SOAP formatter.

Sunday, June 21, 2009 11:33:06 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   General  | 

Threading enables your C# program to perform concurrent processing so you can do more than one operation at a time.
C# supports parallel execution of code through multithreading.Threads are relatively
lightweight processes responsible for multitasking within a single
application.Thread is an independent execution path, able to run simultaneously
with other threads.
For implementing Threading, you first include System.Threading namespace in your project.

class ThreadClass
{
    static void Main() {
    Thread thread1 = new Thread (Display("1");
    Thread thread2 = new Thread (Display("2"));
    thread1.Start();
    thread2.Start();      // Run on the new thread
   
  }

    static void Diaplay(string strparameter)
    {
        while (true) Console.Write(strparameter);   // Write forever
    }
}

In the above program, two thread simultaneously running.
We can share a data between multiple thread through static variable.

class ThreadClass {
  static void Main() {
 static int num;
    Thread thread1 = new Thread (Display("Thread 1");
    Thread thread2 = new Thread (Display("Thread 2"));
    thread1.Start(); 
    thread2.Start();      // Run on the new thread
    
  }
 
  static void Diaplay(string strparameter) {
    while (true) 
    {
  num ++;
  Console.Write (num.ToString() + " " + strparameter);   // Write forever
 }
  }
}

In the above program, we are declaring a num static variable and this number is incrementing
by both thread.

Joining Threads:-Joining is used for blocks the calling thread until a thread terminates. Means
thread to stop processing and wait until a second thread completes its work,
----------
Once a thread starts running and in some situation if we need to tell the thread to stop processing and wait until a second thread completes processing, we need to join the first thread to the second thread. Use the following for the same. This will join the second thread to the first one.
---------

Sleep Threads:- you want to suspend your thread for a short time. For this  Thread
class provide a public static method "Sleep". Sleep is an overloaded function.

Thread.Sleep (Int32):  Suspends the current thread for a specified time.
e.g. thread1.Sleep(1000) //Sleep for 1000 millisecond
 Thread.Sleep (0); // give up CPU time-slice
Thread.Sleep (TimeSpan):  Blocks the current thread for a specified time. 
e.g. Thread.Sleep (TimeSpan.FromSeconds (5));
Thread.Sleep (TimeSpan.FromHours (1)); // sleep for 1 hour
Thread.Sleep (Timeout.Infinite); // sleep until interrupted

Killing Threads: Thread kill itself after completing its task, but you want to kill thread
before completing its task. For this you can use Abort() function.
e.g. thread1.Abort();
-----------
Threads has to die after the execution of the process in normal situations, occasionally it is required for the programmer to kill a thread. Threads can be killed using the following:
-----------
Suspend Thread: You want to stop executing your thread then you use Suspend() method and for running the suspending thread
You use Resume() method.

Thread Priority: Thread priority is basically used for giving which thread is high priority or
low priority. There are five level of priority
*Highest
*AboveNormal
*Normal
*BelowNormal
*Lowest

e.g.
 thread1.Priority = ThreadPriority.BelowNormal;
 thread2.Priority = ThreadPriority.Highest;
 
 Thread.ThreadState Property: ThreadState property gives the current state of thread status.
The initial value is Unstarted.
 ThreadState.Aborted
 ThreadState.AbortRequested
 ThreadState.Stopped
 ThreadState.Unstarted
 ThreadState.WaitSleepJoin;
 ThreadState.Background;
 ThreadState.SuspendRequested;
 ThreadState.Suspended
All of the above property return true or false on the basis of its status.
if you want to check abort status of thread1 then
  if ( thread1.ThreadState == ThreadState.Suspended}
 {
  thread1.Resume();//to again start the thread
 }
Rsume method is used for running the suspended thread. if the thread is not suspended then there will be no effect on thread status.

LOCK
====
"Change Style(Copied)
 lock marks a critical section of the code, and provides synchronization to an object.

Example:

public void Incrementer( )
{
  try
  {
    while (counter < 1000)
    {
      lock (this)
      {
        int temp = counter;
        temp ++;
        Thread.Sleep(1);
        counter = temp;
      }
      // assign the decremented value
      // and display the results
      Console.WriteLine("Thread {0}. Incrementer: {1}", 
         Thread.CurrentThread.Name, counter);
    }
  }

Sunday, June 21, 2009 11:30:18 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   C#  | 

we can attach javascript in code behind using this style

 

private void Page_Load(object sender, System.EventArgs e)

{

System.Text.StringBuilder StrValidation = new System.Text.StringBuilder();

//Appending javascript in this string builder

StrValidation.AppendFormat("{0}",@"<script language='javascript'>

function validateForm()

{

if (isBlank(document.baseForm.txtEmail.value)) {

alert('Email ID can not be blank1 !');

document.baseForm.txtEmail.focus();

return false;

}

if (isBlank(document.baseForm.txtSubject.value)) {

alert('Subject can not be blank !');

document.baseForm.txtSubject.focus();

return false;

}

if (isBlank(document.baseForm.txtMessage.value)) {

alert('Please Enter Message in Message Box !');

document.baseForm.txtMessage.focus();

return false;

}

return true;

} </script>");

Page.RegisterClientScriptBlock("AddValidation",StrValidation.ToString());

this.ibtnSubmit.Attributes.Add("onClick", "return validateForm();");

Sunday, June 21, 2009 11:21:26 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 

private void Page_Load(object sender, System.EventArgs e)

{

      base.OuterTable.HorizontalAlign = HorizontalAlign.Center;

      base.ContentBar.VerticalAlign = VerticalAlign.Top;

}

Sunday, June 21, 2009 11:18:50 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   asp.net  | 

Everyone who writes code

Describe the difference between a Thread and a Process?
What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
What is the difference between an EXE and a DLL?
What is strong-typing versus weak-typing? Which is preferred? Why?
Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.
What is a PID? How is it useful when troubleshooting a system?
How many processes can listen on a single TCP/IP port?
What is the GAC? What problem does it solve?
Mid-Level .NET Developer

Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
Describe what an Interface is and how it’s different from a Class.
What is Reflection?
What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
Are the type system represented by XmlSchema and the CLS isomorphic?
Conceptually, what is the difference between early-binding and late-binding?
Is using Assembly.Load a static reference or dynamic reference?
When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
What is an Asssembly Qualified Name? Is it a filename? How is it different?
Is this valid? Assembly.Load("foo.dll");
How is a strongly-named assembly different from one that isn’t strongly-named?
Can DateTimes be null?
What is the JIT? What is NGEN? What are limitations and benefits of each?
How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
What is the difference between Finalize() and Dispose()?
How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
What does this useful command line do? tasklist /m "mscor*"
What is the difference between in-proc and out-of-proc?
What technology enables out-of-proc communication in .NET?
When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?
Senior Developers/Architects

What’s wrong with a line like this? DateTime.Parse(myString);
What are PDBs? Where must they be located for debugging to work?
What is cyclomatic complexity and why is it important?
Write a standard lock() plus “double check” to create a critical section around a variable access.
What is FullTrust? Do GAC’ed assemblies have FullTrust?
What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
What does this do? gacutil /l | find /i "Corillian"
What does this do? sn -t foo.dll
What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
Contrast OOP and SOA. What are tenets of each?
How does the XmlSerializer work? What ACL permissions does a process using it require?
Why is catch(Exception) almost always a bad idea?
What is the difference between Debug.Write and Trace.Write? When should each be used?
What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
Does JITting occur per-assembly or per-method? How does this affect the working set?
Contrast the use of an abstract base class against an interface?
What is the difference between a.Equals(b) and a == b?
In the context of a comparison, what is object identity versus object equivalence?
How would one do a deep copy in .NET?
Explain current thinking around IClonable.
What is boxing?
Is string a value type or a reference type?
What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
Why are out parameters a bad idea in .NET? Are they?
Can attributes be placed on specific parameters to a method? Why is this useful?
C# Component Developers

Juxtapose the use of override with new. What is shadowing?
Explain the use of virtual, sealed, override, and abstract.
Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
Explain the differences between public, protected, private and internal.
What benefit do you get from using a Primary Interop Assembly (PIA)?
By what mechanism does NUnit know what methods to test?
What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;}
What is the difference between typeof(foo) and myFoo.GetType()?
Explain what’s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?
What is this? Can this be used within a static method?
ASP.NET (UI) Developers

Describe how a browser-based Form POST becomes a Server-Side event like Button1_OnClick.
What is a PostBack?
What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?
What is the <machinekey> element and what two ASP.NET technologies is it used for?
What three Session State providers are available in ASP.NET 1.1? What are the pros and cons of each?
What is Web Gardening? How would using it affect a design?
Given one ASP.NET application, how many application objects does it have on a single proc box? A dual? A dual with Web Gardening enabled? How would this affect a design?
Are threads reused in ASP.NET between reqeusts? Does every HttpRequest get its own thread? Should you use Thread Local storage with ASP.NET?
Is the [ThreadStatic] attribute useful in ASP.NET? Are there side effects? Good or bad?
Give an example of how using an HttpHandler could simplify an existing design that serves Check Images from an .aspx page.
What kinds of events can an HttpModule subscribe to? What influence can they have on an implementation? What can be done without recompiling the ASP.NET Application?
Describe ways to present an arbitrary endpoint (URL) and route requests to that endpoint to ASP.NET.
Explain how cookies work. Give an example of Cookie abuse.
Explain the importance of HttpRequest.ValidateInput()?
What kind of data is passed via HTTP Headers?
Juxtapose the HTTP verbs GET and POST. What is HEAD?
Name and describe at least a half dozen HTTP Status Codes and what they express to the requesting client.
How does if-not-modified-since work? How can it be programmatically implemented with ASP.NET?
Explain <@OutputCache%> and the usage of VaryByParam, VaryByHeader.
How does VaryByCustom work?
How would one implement ASP.NET HTML output caching, caching outgoing versions of pages generated via all values of q= except where q=5 (as in http://localhost/page.aspx?q=5)?
Developers using XML

What is the purpose of XML Namespaces?
When is the DOM appropriate for use? When is it not? Are there size limitations?
What is the WS-I Basic Profile and why is it important?
Write a small XML document that uses a default namespace and a qualified (prefixed) namespace. Include elements from both namespace.
What is the one fundamental difference between Elements and Attributes?
What is the difference between Well-Formed XML and Valid XML?
How would you validate XML using .NET?
Why is this almost always a bad idea? When is it a good idea? myXmlDocument.SelectNodes("//mynode");
Describe the difference between pull-style parsers (XmlReader) and eventing-readers (Sax)
What is the difference between XPathDocument and XmlDocument? Describe situations where one should be used over the other.
What is the difference between an XML "Fragment" and an XML "Document."
What does it meant to say “the canonical” form of XML?
Why is the XML InfoSet specification different from the Xml DOM? What does the InfoSet attempt to solve?
Contrast DTDs versus XSDs. What are their similarities and differences? Which is preferred and why?
Does System.Xml support DTDs? How?
Can any XML Schema be represented as an object graph? Vice versa?

Sunday, June 21, 2009 11:16:13 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   .Net  | 

tempdb is one of the key working areas for your server. Whenever you issue a complex or large query that SQL Server needs to build interim tables to solve, it does so in tempdb. Whenever you create a temporary table of your own, it is created in tempdb, even though you think you’re creating it in the current database. Whenever there is a need for data to be stored temporarily, it’s probably stored in tempdb.

Sunday, June 21, 2009 11:14:49 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SQL Server  | 

A subreport is a report within a report
In Crystal Reports, there are two types of subreports — unlinked and linked.

The Unlinked Subreport
Unlinked subreports do not attempt to coordinate their data with the primary report. In other words, an unlinked subreport does not match up records to the records within a primary report. Unlinked subreports do not need to use the same data as the primary report — in fact, an unlinked subreport often does not even share the same data source as the primary report.

The Linked Subreport
Linked subreports, in comparison to unlinked subreports, do share the same data source as a primary report. A linked subreport's data is linked and coordinated with the primary report's data. In other words, both reports contain records that are matched up.

As an example, say that your primary report contains employee information and your subreport contains order information (where this order information is linked to the employee information). For each employee record, a linked subreport would include all orders for that employee only. You can try your hand at creating a linked subreport later in this chapter.

 

Sunday, June 21, 2009 11:08:55 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   Crystal Report  | 
Copyright © 2010 SoftwareCodeHelp. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: