Thursday, July 17, 2008

Asp.net questions

What is Class ?
      A class is an organized store-house in object-oriented programming that gives coherent functional  abilities to a group of related code. It is the definition of an object, made up of software code. Using classes, we may wrap data and behaviour together (Encapsulation).We may define classes in terms of classes (Inheritance).We can also override the behaviour of a class using an alternate behaviour (Polymorphism).
 
ASP.Net Web Matrix? 
      This is a free ASP.NET development environment from Microsoft. As well as a GUI development environment, the download includes a simple web server that can be used instead of IIS to host ASP.NET apps. This opens up ASP.NET development to users of Windows XP Home Edition, which cannot run IIS. 
 
Web.config file in ASP.NET?
      Web.config file is a configuration file for the Asp.net web application. An Asp.net application has  one web.config file which keeps the configurations required for the corresponding application. Web.config file is written in XML with specific tags having specific meanings. We have Machine.config file also. As web.config file is used to configure one asp.net web  application, same way Machine.config file is used to configure the application according to a particular machine. That is, configuration done in machine.config file is affected on any application that runs on a particular machine. 
 
IIS port number? How We get it?
      IIS default port numbers for http is 80 , for https 81, and for ftp its 21. These are the default port numbers but we can override this port numbers while creating a website (either SSL or normal) and while creating a ftp folder.
 
What is Boxing & Unboxing ?
      Value Types are stored on the stack and Reference types are stored on the heap. The conversion of value type to reference type is known as Boxing. Converting reference type back to value type is known as Unboxing.
      Value Types - Value types are primitive types that are mapped directly to the FCL. Like Int32 maps to System.Int32, double maps to System.double. All value types are stored on stack and all the value types are derived from  System.ValueType. All structures and
enumerated types that are derived from System.ValueType are created on stack, hence known as ValueType.
      Reference Types - Reference Types are different from value types in such way that memory is allocated to them from the heap. All the classes are of reference type. C# new operator returns the memory address of the object.    
 
Diffrence between ServerSide and ClientSideCode? 
      server side code is responsible to execute and provide the executed code to the browser  at the client side. The executed code may be either in XML or Plain HTML. the executed code only have the values or the results that are executed on the server. The clients browser executes the HTML code and displays the result. 
where as the client side code executes at client side and displays the result in its browser. it the client side core consist of certain functions that are to be executed on server then it places request to the server and the server responses as the result in form of HTML.
 
Something about Session ? 
      Sessions can be managed by two ways in case of webfarms: 
      1. Using SQL server or any other database for storing sessions regarding current logged in user. 
      2. Using State Server, as one dedicated server for managing sessions. State Server will run as service on web server having dotnet installed.
      In ASP.NET there is three ways to manage session objects. one support the in-proc mechanism and other two's  support
the out-proc machanism. 
1) In-Proc (By Default) 
2) SQL-Server (Out-proc) 
3) State-Server (Out-Proc) 
 
Define three test cases you should go through in unit testing? 
      1)Positive test cases (correct data, correct output).
     2)Negative test cases (broken or missing data,proper handling).
     3)Exception test cases (exceptions are thrown and caught properly).
 
What is Server.Transfer and Response.Redirect ? 
      Server.Transfer transfers page processing from one page directly to the next page without making a round-trip back to the client's browser. This provides a faster response with a little less overhead on the server. Server.Transfer does not  update  the clients url history list or current url. Response.Redirect is used to redirect the user's browser to another  page  or  site. This performas a trip back to the client where the client's browser is redirected to the new page. The user's browser history list is updated to reflect the new address. 

Diffrence Between ASP ASp.NET ? 
      The points of difference are as follows:
ASP.Net web forms have a code behind file which contains all event handling code. ASP does not have such facility to separate programming logic from design. ASP.Net web forms inherit the class written in code behind. ASP does not have the concept of inheritance.
      ASP.Net web forms use full fledged programming language, while ASP pages use scripting language.
ASP.Net web applications are configurable (web.config) while ASP applications are not. ASP.Net webforms can use custom controls through the @register directive, which is not available with ASP. ASP.Net  web forms have ADO.Net which supports XML integration and integration of data from two or more data sources, while ASP has ADO which is a simple COM object with limited facilities.

What is PostBack & Callback? 
      One technique that current ASP.NET 1.0/1.1 developers use to overcome this postback problem is to use the Microsoft XMLHTTP  ActiveX  object to  send requests to server-side methods from client-side JavaScript. In ASP.NET 2.0, this process has been simplified and encapsulated within the function known as the Callback Manager. 
      The ASP.NET 2.0 Callback Manager uses XMLHTTP behind the scenes to encapsulate the complexities in sending data to and  from  the  servers and clients. And so, in order for the Callback Manager to work, you need a web browser that supports XMLHTTP. Microsoft Internet Explorer is obviously one of them. 
 
What is Cursor? 
      Cursor is a database object used by applications to manipulate data in a  set on  a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time. For example, you can use cursor to include a  list  of all user databases and make multiple operations against each database by passing each database name as a variable.
 
Types of Directive? 
      Directives in ASP.NET control the settings and properties of page and  user  control compilers. They can be included anywhere on a page, although it is standard to place them at the beginning. Directives are used in both .aspx files (ASP.NET pages) and .ascx files (user control pages). ASP.NET pages actually support eight different directives.
@ Page 
@ Control 
@ Import 
@ Implements 
@ Register 
@ Assembly 
@ OutputCache 
@ Reference 
 
what is ado.net ?
      ADO.NET is the primary relational data access model for Microsoft .NET-based applications. It may be used to access data sources for which there is a specific .NET Provider,or, via a.NET Bridge Provider, for which there is a specific OLE DB Provider, ODBC Driver, or JDBC
Driver. 
 
Diffrence between Code Directory and  Bin Directory
      With the introduction of this new Code directory, you might be wondering when to use which directory. If you have an assembly that you want to use in your Web site, create a Bin subdirectory and then copy the dll to that subdirectory. If you are creating reusable
components that you want to use from your ASP.NET  pages, all you need to do is to create those components under the Code directory. Whenever a change occurs in the Code directory, ASP.NET will dynamically recompile the components and automatically make them available to
all the pages in the Web site. Note that you should put  only components into the Code subdirectory. You should  not put pages, Web user controls, or other non-code files ontaining non-code elements into this subdirectory. 

Diffrence between DataReader and DataAdapter 
      DateReader is an forward only and read only cursor type if you are accessing data through DataRead it  shows the data on the web form/control but you can not perform the paging feature on that record(because it's forward only type).Reader isbest fit to show the Data
(where no need to work on data) DataAdapter is not only  connect with the Databse(through Command object)it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected Architecture of .NET show we can populate the records to the DataSet. where as Dataadapter is best fit to work on data.
 
Diffrence between function and StoreProcedure ?
      Both functions and stored procedures can be custom defined and part of any application. Functions, on the
other hand, are designed to send their output to a query or T-SQL statement. For example, User Defined Functions (UDFs) can run an executable file from SQL SELECT or an action query,while Stored Procedures(SPROC)use EXECUTE or EXEC to run. Both are instantiated using CREATE FUNCTION.
      stored procedures are designed to return its output to the application. A UDF returns table variables, while SPROC can't return a table variable although it can create a table. Another significant difference between them is that UDFs can't change server environment or your operating system environment, while a SPROC can. Operationally, when T-SQL encounters an error the function stops, while T-SQL will ignore an error in a SPROC and proceed to the next statement in your code (provided you've included error handling support). You'll also find that although a SPROC can be used in an XML FOR clause, a UDF cannot be.
 
Type of garbage collector?
      There are two types of Garbage Collectors: managed  and unmanaged. see we will declaring variable ,object in our programes once this kind of variable,object goes out of the scope ,they are put into the heap and they are checked for the further existence. once its beeing no longer used garbage collector wil deallcate  mem for  that variable and objects.
      Umanaged garbage collector: this was done  mannually and u will be happen to open a connection with  database, will be open the file etc. while this kind of the thing goes out of the scope we have to explicitly call the garage colector by calling the closecommand of the datbase once the connection is closed it puts this memmory ino the heep and process follws the same.

what is the difference between serializable and MarshalByRefObjec
      In .net Remoting if you want your class to be participated in remoting it has to inherit from MarshalByRefObject.class so that class definition can be passed by reference Where as [seraliazable] attribute is preceded before class that is can be serialized but this is used in conjuction with MarshalByValue class. Because when we pass by value then only we require this attribute.
 
What is side-by-side execution
      The side-by-side is the ability to run multiple version of an application or component on the same computer. And it is not possible one is private and another is public assembly means. In other words:Side-by-side execution is the ability to install multiple versions of code so that an application can choose  which version of the common language runtime or of a component it uses. Subsequent installations of other versions of the runtime, an application, or a component will not affect applications already installed.
 
What is a join and List different types of joins. 
      Joins are used in queries to explain how different tables are related. Joins also let you  select data from a table depending upon data from another table. 
      Types of joins:
INNER JOINs,OUTER JOINs,CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER
JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS. 
 
What is the managed and unmanaged code in .net? 
      The .NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services that make the  development process easier. Compilers and tools expose the runtime's functionality and enable you to write code that benefits from this managed execution environment. Code that you develop with a language compiler that targets the runtime is called managed code; it benefits  from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services.
 
What is Global Assembly Cache (GAC) and what is the purpose of it? 
      Each computer where the common language runtime is installed has a machine-wide code cache called the global assembly cache. The global assembly cache stores assemblies specifically designated to be shared  by several applications on the computer. You should share assemblies by installing them into the global assembly cache only when you need to. 
 
 
What is Isolation Level? 
      An isolation level determines the degree of isolation of data between concurrent transactions. The default SQL Server isolation level is Read Committed. A lower isolation level increases concurrency, but at the expense of data correctness. Conversely, a higher isolation level ensures that data is correct, but can affect concurrency negatively. The isolation level required by an application determines the locking behavior SQL Server uses. SQL-92 defines the following isolation levels, all of which are supported by SQL Server: 
Read uncommitted (the lowest level where transactions are isolated only enough to ensure that physically corrupt data is not read). 
Read committed (SQL Server default level). 
Repeatable read. 
Serializable (the highest level, where transactions are completely isolated from one another). 
 
What is sorting and what is the difference between sorting and clustered indexes? 
      The ORDER BY clause sorts query results by one or more columns up to 8,060 bytes. This will happen
by the time when we retrieve data from database. Clustered indexes physically sorting  data, while
inserting/updating the table. 
 
What is Reflection in .NET? 
      All .NET compilers produce metadata about the types defined in the modules they produce.This metadata is packaged along with the module (modules in turn are  packaged  together in assemblies), and can be accessed by a mechanism called reflection. The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly. 
 
What are Namespaces? 
      The namespace keyword is used to declare a scope. This namespace scope lets you organize code and gives you a way to create globally-unique types. Even if you  do not explicitly declare one, a default namespace is created. This unnamed namespace, sometimes called the
global namespace, is present in every file. Any identifier in the global namespace is available for use in a named namespace. Namespaces implicitly have public access and this is not modifiable. 
 
The ASP.NET page Lifecycle ?
      (1) PreInit()
In Page level event, all controls created during design time are initialized with their default values. 
All events except the Init() and Unload() are fired from outermost to the innermost control. So PreInit() in the Page is the first event to fire but User Controls or MasterPage do not have any PreInit event. Only after the Page_PreInit()event the Init() events of other controls fire up.
      (2)OnInit()
In this event, we can read the control properties (which is set at design time). We cannot read control values changed by the user because that changed value will get loaded after LoadPostData()event fires. But we can access control values from the forms POST data as:
string selectedValue = Request.Form[controlID].ToString();
      (3)LoadViewState
This will only fire if the Page has posted back.Here the runtime de-serializes the view state data from the hidden form element and loads all controls who have view state enabled.
      (4)LoadPostBackData
In this event the controls which implement IPostBackDataHandler interface gets loaded by the values  from the HTTP POST data. Note that a textbox control does not gets its value from the view state but from the post data in the form in this event. So even if you disable view state for a particular control, it can get its value from the HTTP POST data if it implements IPostBackDataHandler interface. Also,an important point to note that if we have a DropDownList control and we have dynamically added some items to it, the runtime cannot load those values unless the viewstate is enabled. The reason being that HTTP Post data has only one value per control. The entire value collection is not maintained in the PostData but in view state.
      (5)Page_Load
If the page has user control, then it's Load method will fire after the Page class's Load method. Except the Init() all are fired from the outermost control to the innermost. So after Page_Load(), load methods of all other controls are fired recursively.
      (6)Control Event Handlers
These are basically event handlers(like Button1_Click()) which are defined for controls. (7)PreRender
This event is again recursively fired for all child controls in the Page. If we want to make any changes to control values, this is the last event we have to peform the same. 
      (8)SaveViewState
Here, the ViewState of the controls gets saved in the form's hidden control.
      (9)Render
In this method all controls are rendered recursively (i.e. Render method of each control is called). 
      (10)Unload
This event has no relevance besides clean up operations because the Page has already rendered. 
 
ASP.NET Globalization and Localization  
      Globalization is the process of designing and developing applications that function for multiple cultures, and localization is the process of customizing your application for a given culture and locale. The topics in this section describe how to create ASP.NET Web applications that can be adapted to different languages and cultures.
 
Form Authentication in ASP.NET
The web.config file 
  
    
      
        
           loginUrl="login.aspx" protection="All" 
           timeout="30" path="/" />
      
      
        
      
    
  
 
What is DLL Hell ?
      Dll hell problem is actualy registation and versionig probelem which is occure in vb6.0.this problem is solve in .netframework in this every project has its own dll(dynamic link library) file.and this file is not overwrite by dll file of another project when we instaling .netproject on machine where already install a .netframework project. 
 
What’s the diff between a primary key and a unique key? 
      Both primary key and unique enforce uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key
doesn’t allow NULLs, but unique key allows one NULL only. 
 
What is View and its Detail? 
      Views are nothing but saved SQL statements, and are sometimes referred as “Virtual Tables”. Views cannot store data(except for Indexed Views); rather they only refer to data present in tables.
 
Syntax:-
CREATE VIEW   View_Name
AS 
          SELECT Statement         
GO
 
      There are 2 important options that can be used when a view is created. They are SCHEMABINDING and ENCRYPTION. 
      Creating a view with SCHEMABINDING option locks the tables being referred by the view and prevents any changes that may change the table schema. Encryption option encrypts the definition of the view. Users will not be able to see the definition of the View after it is created. Once encrypted, there is no way to decrypt it again. So be very careful when you are using
the ENCRYPTION option.
      Limitations of Views:- There are some limitations when using Views. 
      1)SELECT INTO cannot be used in the View 
      2)Temporary tables cannot be used within the View 
      3)Parameterized views does not exists i.e., you cannot pass parameters to the Views.
      4)COMPUTE & COMPUTE BY clauses cannot be used within the View.
 
What is RAD ? 
      Rapid application development (RAD), is a software development process developed initially by James Martin in the 1980s. The methodology involves iterative development, the construction of prototypes, and the use of Computer - aided software engineering (CASE) tools.  
 
What is Object? 
      In simple words Object is just only an instance of Class. Objects are uniquely identifiable by a name. Therefore you should have two different objects with the same set of values. Its contain two main things: State and Behavior.
Sate:- State is represented by the values of its attributes at a particular time.
Behavior:- The behavior of an object is defined by the set of methods which can be applied on it.
 
Describe session handling in a webfarm ? 
      State Server is used for handling sessions in a web farm. For session state to be maintained across different web servers in the web farm, the Application Path of the website (For example \LM\W3SVC\2) in the IIS Metabase should be identical in all the web servers in the web farm. Also, make sure your objects are serializable.
 
What is Managed Heap? 
      The .NET framework includes a managed heap that all .NET languages use when allocating reference type objects. Lightweight objects known as value types are always allocated on the stack, but all instances of classes and arrays are created from a pool of memory known as the managed heap. 
 
What are client activated objects and server activated objects ? 
      Basically for a SAO, the lifetime of the object is controlled by server, whereas for CAO, the lifetime is controlled by the client. Server Activated Objects includes Single Call & Singleton. 
      Single Call objects service one and only one request coming in. Single Call objects are useful in scenarios where the objects are required to do a finite  amount of work. Single Call objects are usually not required to store state information, and they cannot hold state information between method calls. However, Single Call objects can be configured in a load-balanced fashion. 
      Singleton objects are those objects that service multiple clients and hence share data by storing state information between client invocations. 
      They are useful in cases in which data needs to be shared explicitly between clients and also in the  overhead of creatings and maintaining objects are substantial. 
      Client-activated objects (CAO) are server-side objects that are activatedupon request from the client. This way of activating server objects is very similar to the classic COM coclass activation. When the client
submits a request for a server object using "new" operator, an activation request message is sent to the remote application. 
      The server then creates an instance of the requested class and returns an ObjRef back to the clientapplication that invoked it. A proxy is then created on the client side using the ObjRef. The client's method calls will be executed on the proxy. 
Client - activated objects can store state information between method callsfor its specific client and not across different client objects. Each invocation of "new" returns a proxy to an independent instance of theserver type.
 
What r the ASP.NET List Control ? 
      ASP.NET List controls ==> There are 3.
1. DropDownList, 2. ListBox and 3.HTMLSelect.
      1. System.Web.UI.WebControls. DropDownList this  control renders a drop-down list in the page at runtime. Only the selected item is  visible  when  the  user is not interacting with the list, and the other items become visible when the user clicks the control to see items that can be selected. Only one item can be selected in this control. This control must be inserted
into a server side form (runat="server") applied.
      2. System.Web.UI.WebControls.ListBoxthis control  renders a list of items within a scrolling box, multiple items can be selected in this control if required. This control must be inserted into a server side form (runat="server") applied.
      3. System.Web.UI.HTMLControls.HTMLSelectthis  control can be used to render a drop-down list or a scrolling list of items. This control has less built in functionality when compared with controls above (It lacks many of the properties that can be used to influence the display style such as ForeColor and BackColor to name a couple),but it is still capable of performing most common uses of a list control. This control can be inserted anywhere, and does not require a server side form.
 
What is Dll Hell? 
      DLL Hell is nothing but overwriting the dll in the registery. If two application are installed on a single server, one installed First and the Second Installed Later and There is a dll with same name with different functionality used in both the applications, So in this case Application one works fine all the days until application two Installed on the machine. Once the Application two is installed containing the DLL with the same name as Application one Contains then In this case the application one Fails as the DLL from Application  two overwites the DLL of Application one in the
Registery. So Application two works fine where as Application one Fails as the DLL is missing. 
 
Diffrence between Interface and Abstract class ? 
      (1)Multiple inheritance
      -A class may inherit several interfaces.
      -A class may inherit only one abstract class.
      (2)Default implementation
      -An interface cannot provide any code, just the signature.
      -An abstract class can provide complete, default code and/or just the details that have to be overridden.
      (3)Constants
      -Only Static final constants.
      -Both instance and static constants are possible.
      (4)Core VS Peripheral
      -Interfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit
      from a IMovable interface.
      -An abstract class defines the core identity of a class and there it is used for objects of the same type.
      (5)Homogeneity
      -If the various implementations only share method signatures then it is better to use Interface.
      -If the various implementations are of the same kind and use common behaviour or status then abstract class is better
      to use.
      (6)Speed
      -Requires more time to find the actual method in the corresponding classes.
      -Fast
      (7)Adding functionality
      -If we add a new method to an Interface then we have to track down all the implementations of the interface and define
      implementation for the new method.
      -If we add a new method to an abstract class then we have the option of providing default implementation and therefore
      all the existing code might work properly.
which dll handles the request of .aspx page ? 
      When the Internet Information Service process (inetinfo.exe) receives an HTTP request, it uses the filename extension of
the  requested  resource to  determine which Internet Server Application Programming Interface (ISAPI) program to run to
process the request. When  request is for an ASP.NET page (.aspx file), IIS passes the request to the ISAPI DLL capable of handling the request for ASP.NET pages, which is aspnet_isapi.dll.
 
What do u mean by XSD,XSLT & XML? 
      XSD stands for XML Schema Definition. It define the structure of the XML file and the elements and attributes it contains the datatype of the elements. So that when u populate XML data into dataset, the dataset can treat elements differently based on their type. If XSD is not present dataset treats all elements as string type. XSLT stands XML style sheet lang tranformation. It is lang used for transforming XML data in one format to another format. Example XML data into HTML format. XSLT uses XPath to identify the elements in XML doc and transform those to desired format.
 
What is data modeling and data mining ? 
      Data modeling is the process of designing a data base model. In this data model data will be stored in  two types of table fact table and dimention table. Fact table contains the transaction data and dimention table contains the master data. Data mining is process of finding the hidden trends is called the data mining.
 
What is Sealed class ? 
      A class can be made sealed in c# using the sealed keyword. When you do that, it implies that the class cannot be inhereted. You can extend this functionality to the individual methods as well. In case you want a class to be inhereted, excluding one of its methods, just make that particular method sealed.
 
Diffrence bteween Shadowing and Hiding ? 
      Shadowing :-This is VB.Net Concept by which you can provide a new implementation for base class member without overriding the member. You can shadow a base class member in the derived class by using the keyword "Shadows". The method  signature, access level and return type of the shadowed member can be completely different than the base class member.
 
      Hiding:- This is a C# Concept by which you can provide a new implementation for the base class member without overriding the member. You can hide a base class member in the derived class by using the keyword "new". The method signature, access level and return type of the hidden member has to be same as the base class member. 
      Comparing the three :-
      1) The access level , signature and the return type can only be changed when you are shadowing with VB.NET. Hiding and overriding demands these parameters as same.
      2) The difference lies when you call derived class object with a base class variable. In class of overriding although you assign a derived class object to base class variable it will call derived class function. In case of shadowing or hiding the base class function  will be called.
 
Why multiple Inheritance not work in C# ? 
      When we use the Multiple inheritance, we have to use more than one class. Lets one condition class A and class B are base classes and class c is multiple inherting it. And where class c is inheriting a function, It may be possible that this function
with same name and same signature can present in both class A and Class B. That time how the compiler will know that which function it should take wherether from class A or class B. So Multiple inheritance show's an error.
 
What is Web Application ? 
      Web application consists of document and code pages in various formats. The simplest kind of document is
a static HTML page, which contains information that will be formatted and displayed by a Web browser. An
HTML page may also contain hyperlinks to other HTML pages. A hyperlink(or just link) contains an address,
or a Uniform Resource Locator(URL), specifying where the target document is located. The resulting combination  of content and links is sometimes called hypertext and provides easy navigation to a vast amount of information on the World Wide Web. 
 
How to Get DateDiffrence ? 
DateTime startTime = DateTime.Now;
DateTime endTime = DateTime.Now.AddSeconds( 75 );
TimeSpan span = endTime.Subtract ( startTime );
Console.WriteLine( "Time Difference (seconds): " + span.Seconds );
Console.WriteLine( "Time Difference (minutes): " + span.Minutes );
Console.WriteLine( "Time Difference (hours): " + span.Hours );
Console.WriteLine( "Time Difference (days): " + span.Days );
 
 
How to create a cookie in C#? 
HttpCookie cookie;
String UserID = "dotnetquestion";
cookie = new HttpCookie("ID");
cookie.Values.Add("ID", ID);
Response.Cookies.Add(cookie); 
 
Diff between DELETE TABLE and TRUNCATE TABLE commands?
      DELETE TABLE is a logged operation, so the deletion of each row gets logged in the transaction log, which  makes it slow. TRUNCATE TABLE also deletes all the rows in a table, but it won't log the deletion of each row, instead it logs the deallocation of the data pages of the table, which makes it faster. Of course, TRUNCATE TABLE can be rolled back.
 
Define candidate key, alternate key, composite key?
      candidate key is one that can have row of a table unique. Generally a candidate key is primary key of the table. If the table has more than one candidate key, one of them will become the primary key, and the rest are called alternate keys. A key formed by combining
at least two or more columns is called composite key. 
 
what is Early & Late Binding ?
      Early binding is to know the type of an object at compile time. The compiler have all the needed element at compile time to build the call into the excutable code. 
      late binding, the type of an object is known only at runtime. It will need extra instructions to find out where is the method to be called before calling it.
 
What is exception handling ?
      When an exception occurs, the system searches for the nearest catch clause that can handle the exception, as determined by the run-time type of the exception. First, the current method is searched for a lexically enclosing try statement, and the associated catch clauses of the try statement are considered in order. If that fails, the method that called the current method is
searched for a lexically enclosing try statement that encloses the point of the call to the current method. This search continues until a catch clause is found that can handle the current exception, by naming an exception class that is of the same class, or a base class, of the
run-time type of the exception being thrown. A catch clause that doesn't name an exception class can handle any exception. Once a matching catch clause is found, the system prepares to transfer control to the first statement of the catch clause. Before execution of the catch clause begins, the system first executes, in order, any finally clauses that were associated
with try statements more nested that than  the one that  caught the exception. Exceptions that occur during  destructor execution are worth special mention. If an exception occurs during destructor execution, and that exception is not caught, then the execution of that destructor is terminated and the destructor of the base class (if any) is called. If there is no base class or if there is no base class destructor, then the exception is discarded.
 
What is an extended stored procedure ?
      Extended stored procedure is a function  within  a DLL(written in a language like C, C++ using Open Data Services (ODS) API) that can be called from T-SQL, just the way we call normal stored procedures using the EXEC statement. 
 
How to get the hostname or IP address of the server ? 
      HttpContext.Current.Server.MachineName 
HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"]. The first one should return the name of the machine, the second returns the local ip address. Note that name of the machine could be different than host, since your site could be using host headers.
 
What is a parser error ?
      Its basically a syntax error in your ASPX page. It happens when your page is unreadable for the part of ASP.NET that transforms your code into an executable.
 
Difference between Triggers and Storedprocedures ?
      Triggers are basically used to implement business rules. Triggers is also similar to stored procedures. The difference is that it can be activated when data is added or edited or deleted from a table in a database. Triggers are special kind of stored procedures that get
executed automatically when an INSERT,UPDATE or DELETE operation takes place on a table.
 
How to register Assemblies in GAC ?
      The assemblies are stored in the global assembly cache, which is a versioned repository of assemblies made available to all applications on the machine not like Bin and App_Code. Several assemblies in the Framework are automatically made available to ASP.NET applications. You can register additional assemblies by registration in a Web.config file in your application. 
 
Can we develop web pages directly on an FTP server ? 
      Yes. Visual Web Developer now has built-in support for editing and updating remote web projects using the standard File Transfer Protocol(FTP). You can quickly  connect to a remote Web site using FTP within the New Web Site and Open Web Site dialog box. 
 
What is Store Procedure ? 
      A stored procedure is a set of structured query language statements that you assign a name and store it in to the database in a compiled form so that it can share between no of programs. 
      Some advantage of Store Procedure:
      1)They allow faster execution
      2)They can reduce network traffic
 
What are Indexes in SQL SERVER?
      Microsoft SQL Server index helps in creating the structure of table that helps in speeds retrieval of the rows in the table. An index create a keys from one or more columns in the table. These keys are stored in a structure that allows SQL Server to find the row or rows created with the key values quickly and efficiently. If a table doest not containeated indexes, the data rows are not stored in any specific order. This structure is stored on heap. 
      There are  two types of SQL Server indexes: 
 
      (1)Clustered:- 
         Clustered indexes helps in sorting and storeing the data rows in the table take key values as base. Because the data rows are stored in sorted order on the  clustered index key, clustered indexes more efficient  for finding rows. There is only one clustered index per table. The data rows themselves form the lowest level of the clustered index. The only time the data rows in a table are stored in sorted order is when table contains a clustered index. If a table has no clustered index, its data rows are stored in a heap. 
 
      (2)Nonclustered:- 
      structure of Nonclustered indexes sis diffrent from the data rows. The lowest rows of a nonclustered index have the nonclustered index key values and each key value entry has pointers to the data rows containing the key value. The data rows are not stored in order based on the nonclustered key. The pointer from an index row in a nonclustered index to a data row is called a row locator. The structure of the  row locator depends on whether the data pages are stored in a heap or clustered. In heap, a row locator is a pointer that points the row. For a table with a clustered index, the row locator is the clustered index key.
 
What are the different types of Joins ? 
      Joins helps to combine the contents of two or more tables to get a specific result set. It incorporates rows and columns from each table. Tables are typically joined using data that they have in common Join conditions can be specified in either the FROM or WHERE clauses. WHERE and HAVING clauses can also contain search conditions to further filter the rows selected by the join conditions.
Joins are of diffrent types:-
      Inner joins - An inner join in which the values in the columns being joined are compared using a comparison operator. Inner joins use a comparison operator to match rows from two tables based on values in common columns from each table.
 
      Equi Join - It returns full columns in both tables, and returns only the rows for which there is an equal value in the join column.
 
      Self Join - A table can be joined to itself in a self-join.
 
      Cross joins - Cross joins produce all rows from the left table, and each row from the left table is combined with all rows from the right table. Cross joins are also called Cartesian products.
 
      Outer joins - Outer joins can be of three typs left, right, full outer join.
 
 

ADO.NET

What is Concurrency and its types?
When two or more people try to update same type of data then Concurrency helps how to handle this situation there are two types of concurrency:pessimistic and optiimistic.
Pessimistic:-When one user try to change the data with pessimistic concurrency a lock is placed on the data so that another user cannot change that one after one another can change.
Optimistic:-In this if two user works on the same data and one change that data first then second user cannot change that same data becasue the which he have using is allready changed so he cannot do the change becasue change apply to another data that is changed by first user.


Why is ADO.NET serialization slower than ADO ?
ADO uses binary serialization while ADO.NET uses text based serialization. Since the text takes more space, it takes longer to write it out.

How to check if the Dataset has records ?

if ds.Tables(0).Rows.Count= 0 then
'No record
else
'record found

What’s the use of CommandBehavior.CloseConnection?

To avoid having to explicitly close the connection associated with the command used to create either a SqlDataReader or and OleDbDataReader, pass the CommandBehavior.CloseConnection argument to the ExecuteReader method of the Connection.

dr= cmd.ExecuteReader(CommandBehavior.CloseConnection);

The associated connection will be closed automatically when the Close method of the Datareader is called. This makes it all the more important to always remember to call Close on your datareaders.

Which method do you invoke on the DataAdapter control to load your generated dataset with data?
The Fill() method.

What is Dataset and Diffgram?
When sending and retrieving a DataSet from an XML Web service, the DiffGram format is implicitly used. Additionally, when loading the contents of a DataSet from XML using the ReadXml method, or when writing the contents of a DataSet in XML using the WriteXml method, you can select that the contents be read or written as a DiffGram. For more information, see Loading a DataSet from XML and Writing a DataSet as XML Data. While the DiffGram format is primarily used by the .NET Framework as a serialization format for the contents of a DataSet, you can also use DiffGrams to modify data in tables in a Microsoft SQL Server™ 2000 database.

What is typed dataset ?
A typed dataset is very much similar to a normal dataset. But the only difference is that the sehema is already present for the same. Hence any mismatch in the column will generate compile time errors rather than runtime error as in the case of normal dataset. Also accessing the column value is much easier than the normal dataset as the column definition will be available in the schema.

How can you provide an alternating color scheme in a Repeater control?
AlternatingItemTemplate Like the ItemTemplate element, but rendered for every other row (alternating items) in the Repeater control. You can specify a different appearance for the AlternatingItemTemplate element by setting its style properties.

What are good ADO.NET object(s) to replace the ADO Recordset object?
There are alot...but the base once are SqlConnection, OleDbConnection, etc...

Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
Valid answers are:

  • A DataSet can represent an entire relational database in memory, complete with tables, relations, and views.
  • A DataSet is designed to work without any continuing connection to the original data source.
  • Data in a DataSet is bulk-loaded, rather than being loaded on demand.
  • There's no concept of cursor types in a DataSet.
  • DataSets have no current record pointer You can use For Each loops to move through the data.
  • You can store many edits in a DataSet, and write them to the original data source in a single operation.
  • Though the DataSet is universal, other objects in ADO.NET come in different versions for different data sources.

What are the differences between Datalist DataGrid and datarepeater ?
DataList

  • Has table appearence by default
  • Has no autoformat option
  • has no default paging & sorting options
  • can define separators between elements using template
    DataGrid
  • Has a grid appearence by default
  • has a autoformat option
  • has default paging and sorting
  • has no separator between elements
    DataRepeater
  • simple,read-only output, has no built in support for selecting or editing items, has no DEFAULT APPEARENCE, has no default paging.

ASSEMBLY

What do you know about .NET assemblies?

Assemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows services, serviced components, and .NET remoting applications.

What’s the diff between private and shared assembly?
Privateassembly
is used inside an application only and does not have to be identified by a strong name.
Shared assembly can be used by multiple applications and has to have a strong name.

What’s a strong name ?
A strong name includes the name of the assembly, version number, culture identity, and a public key token.

Whats an assembly ?

Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.

How can you debug failed assembly binds ?
Use the Assembly Binding Log Viewer (fuslogvw.exe) to find out the paths searched.

Where are shared assemblies stored ?
Global assembly cache.

How can you tell the application to look for assemblies at the locations other than its own install ?
Use the directive in the XML .config file for a given application.



should do the trick. Or you can add additional search paths in the Properties box of the deployed application.

Where’s global assembly cache located on the system ?
Usually C:\winnt\assembly or C:\windows\assembly.

How do you specify a custom attribute for the entire assembly (rather than for a class) ?
Global attributes must appear after any top-level using clauses and before the first type or namespace declarations. An example of this is as follows:
using System;
[assembly : MyAttributeClass] class X {}

Note that in an IDE-created project, by convention, these attributes are placed in AssemblyInfo.cs.

What is delay signing ?
Delay signing allows you to place a shared assembly in the GAC by signing the assembly with just the public key. This allows the assembly to be signed with the private key at a later stage, when the development process is complete and the component or assembly is ready to be deployed. This process enables developers to work with shared assemblies as if they were strongly named, and it secures the private key of the signature from being accessed at different stages of development.

ASP.NET BASIC

The IHttpHandler and IHttpHandlerFactory interfaces

The IHttpHandler interface is implemented by all the handlers. The interface consists of one property called IsReusable. The IsReusable property gets a value indicating whether another request can use the IHttpHandler instance. The method ProcessRequest() allows you to process the current request. This is the core place where all your code goes. This method receives a parameter of type HttpContext using which you can access the intrinsic objects such as Request and Response. The IHttpHandlerFactory interface consists of two methods - GetHandler and ReleaseHandler. The GetHandler() method instantiates the required HTTP handler based on some condition and returns it back to ASP.NET. The ReleaseHandler() method allows the factory to reuse an existing handler.

what is Viewstate?
View state is used by the ASP.NET page framework to automatically save the values of the page and of each control just prior to rendering to the page. When the page is posted, one of the first tasks performed by page processing is to restore view state.
State management is the process by which you maintain state and page information over multiple requests for the same or different pages.

Client-side options are:

* The ViewState property

* Query strings

* Hidden fields

* Cookies

Server-side options are:

* Application state

* Session state

* DataBase

Use the View State property to save data in a hidden field on a page. Because ViewState stores data on the page, it is limited to items that can be serialized. If you want to store more complex items in View State, you must convert the items to and from a string.

ASP.NET provides the following ways to retain variables between requests:

Context.Handler object Use this object to retrieve public members of one Web form’s class from a subsequently displayed Web form.

Query strings Use these strings to pass information between requests and responses as part of the Web address. Query strings are visible to the user, so they should not contain secure information such as passwords.

Cookies Use cookies to store small amounts of information on a client. Clients might refuse cookies, so your code has to anticipate that possibility.

View state ASP.NET stores items added to a page’s ViewState property as hidden fields on the page.

Session state Use Session state variables to store items that you want keep local to the current session (single user).


Application state Use Application state variables to store items that you want be available to all users of the application.

DOTNET PAGE LIFECYCLE ?
While excuting the page, it will go under the fallowing steps(or fires the events) which collectivly known as Page Life cycle.
Page_Init -- Page Initialization
LoadViewState -- View State Loading
LoadPostData -- Postback data processing
Page_Load -- Page Loading
RaisePostDataChangedEvent -- PostBack Change Notification
RaisePostBackEvent -- PostBack Event Handling
Page_PreRender -- Page Pre Rendering Phase
SaveViewState -- View State Saving
Page_Render -- Page Rendering
Page_UnLoad -- Page Unloading


What is Satellite Assemblies ?
Satellite assemblies are often used to deploy language-specific resources for an application. These language-specific assemblies work in side-by-side execution because the application has a separate product ID for each language and installs satellite assemblies in a language-specific subdirectory for each language. When uninstalling, the application removes only the satellite assemblies associated with a given language and .NET Framework version. No core .NET Framework files are removed unless the last language for that .NET Framework version is being removed. For example, English and Japanese editions of the .NET Framework version 1.1 share the same core files. The Japanese .NET Framework version 1.1 adds satellite assemblies with localized resources in a \ja subdirectory. An application that supports the .NET Framework version 1.1, regardless of its language, always uses the same core runtime files.

What is CAS ?
CAS: CAS is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting your hard disk. How does CAS work? The CAS security policy revolves around two key concepts - code groups and permissions. Each .NET assembly is a member of a particular code group, and each code group is granted the permissions specified in a named permission set. For example, using the default security policy, a control downloaded from a web site belongs to the 'Zone - Internet' code group, which adheres to the permissions defined by the 'Internet' named permission set. (Naturally the 'Internet' named permission set represents a very restrictive range of permissions.)

Automatic Memory Management ?
Automatic Memory Management: From a programmer's perspective, this is probably the single biggest benefit of the .NET Framework. No, I'm not kidding. Every project I've worked on in my long career of DOS and Windows development has suffered at some point from memory management issues. Proper memory management is hard. Even very good programmers have difficulty with it. It's entirely too easy for a small mistake to cause a program to chew up memory and crash, sometimes bringing the operating system to a screeching halt in the process.

Programmers understand that they're responsible for releasing any memory that they allocate, but they're not very good at actually doing it. In addition, functions that allocate memory as a side effect abound in the Windows API and in the C runtime library. It's nearly impossible for a programmer to know all of the rules. Even when the programmer follows the rules, a small memory leak in a support library can cause big problems if called enough.

The .NET Framework solves the memory management problems by implementing a garbage collector that can keep track of allocated memory references and release the memory when it is no longer referenced. A large part of what makes this possible is the blazing speed of today's processors. When you're running a 2 GHz machine, it's easy to spare a few cycles for memory management. Not that the garbage collector takes a huge number of cycles--it's incredibly efficient.
The garbage collector isn't perfect and it doesn't solve the problem of mis-managing other scarce resources (file handles, for example), but it relieves programmers from having to worry about a huge source of bugs that trips almost everybody up in other programming environments.
On balance, automatic memory management is a huge win in almost every situation.


What Language familar to CLR?
Any language that can be compiled into Microsoft Intermediate Language (MSIL) is considered a .NET-compliant language. Following are a few of the popular .NET-compliant languages supported by CLR:

APL

COBOL

Component Pascal

Eiffel

Fortran

Haskell

JScript

Mercury

Oberon

Pascal

Perl

Python

Smalltalk

Visual Basic

Visual C#

Visual C++

OOPS

What Is OOPS ?
OOPs is an Object Oriented Programming language,which is the extension of Procedure Oriented Programming language.OOPS reduce the code of the program because of the extensive feature of Polymorphism. OOPS have many properties such as Data-Hiding,Inheritence,Data Absraction,Data Encapsulation and many moreEverything in the world is an object. The type of the object may vary. In OOPS, we get the power to create objects of our own, as & when required.

what is Class ?
A group of objects that share a common definition and that therefore share common properties, operations, and behavior. A user-defined type that is defined with the class-key 'class,' 'struct,' or 'union.' Objects of a class type consist of zero or more members and base class objects.Classes can be defined hierarchically, allowing one class to be an expansion of another, and classes can restrict access to their members.

What is Constructor?
When we create instance of class a special method of that class, called that is constructor. Similarly, when the class is destroyed, the destructor method is called. These are general terms and usually not the actual member names in most object-oriented languages. It is initialized using the keyword New, and is destroyed using the keyword Finalize.

What is Abstract Class ?
Classes that cannot be instantiated. We cannot create an object from such a class for use in our program. We can use an abstract class as a base class, creating new classes that will inherit from it. Creating an abstract class with a certain minimum required level of functionality gives us a defined starting point from which we can derive non-abstract classes. An abstract class may contain abstract methods & non-abstract methods. When a class is derived from an abstract class, the derived class must implement all the abstract methods declared in the base class. We may use accessibility modifiers in an abstract class.An abstract class can inherit from a non-abstract class. In C++, this concept is known as pure virtual method.

What is ValueType?
Value Types - Value types are primitive types. Like Int32 maps to System.Int32, double maps to System.double.All value types are stored on stack and all the value types are derived from System.ValueType. All structures and enumerated types that are derived from System.ValueType are created on stack, hence known as ValueType.In value type we create a copy of object and uses there value its not the original one.

What is diff. between abstract class and an interface?
An abstract class and Interface both have method only but not have body of method.The difference between Abstract class and An Interface is that if u call Ablstract class then u have to call all method of that particular Abstract class but if u call an Interface then it is not necessary that u call all method of that particular interface.Method OverLoading:-Return type, Parameter type, parameter and body of method number may be different.Method Overriding:- Return type, Parameter type, Parameter Number all must be same . Only body of method can change.

 

COM - DCOM

Which namespace do the classes, allowing you to support COM functionality, are located?
System.EnterpriseServices

How do you make a NET component talk to a COM component?
To enable the communication between COM and .NET components, the .NET Framework generates a COM Callable Wrapper (CCW). The CCW enables communication between the calling COM code and the managed code. It also handles conversion between the data types, as well as other messages between the COM types and the .NET types.

can a COM object talk to a .NET object?
Yes, through Runtime Callable Wrapper (RCW) or PInvoke.

How do you generate an RCW from a COM object?
Use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library from Visual Studio in your project.

I can’t import the COM object that I have on my machine. Did you write that object?
You can only import your own objects. If you need to use a COM component from another developer, you should obtain a Primary Interop Assembly (PIA) from whoever authored the original object.

How do you call unmanaged methods from your .NET code through PInvoke?
Supply a DllImport attribute. Declare the methods in your .NET code as static extern. Do not implement the methods as they are implemented in your unmanaged code, you’re just providing declarations for method signatures.

Can you retrieve complex data types like structs from the PInvoke calls?
Yes, just make sure you re-declare that struct, so that managed code knows what to do with it.

I want to expose my .NET objects to COM objects. Is that possible?
Yes, but few things should be considered first. Classes should implement interfaces explicitly. Managed types must be public. Methods, properties, fields, and events that are exposed to COM must be public. Types must have a public default constructor with no arguments to be activated from COM. Types cannot be abstract.

Can you inherit a COM class in a .NET application?
The .NET Framework extends the COM model for reusability by adding implementation inheritance. Managed types can derive directly or indirectly from a COM coclass; more specifically, they can derive from the runtime callable wrapper generated by the runtime. The derived type can expose all the method and properties of the COM object as well as methods and properties implemented in managed code. The resulting object is partly implemented in managed code and partly implemented in unmanaged code.

Suppose I call a COM object from a .NET applicaiton, but COM object throws an error. What happens on the .NET end?
COM methods report errors by returning HRESULTs; .NET methods report them by throwing exceptions. The runtime handles the transition between the two. Each exception class in the .NET Framework maps to an HRESULT.

CSS

What do u mean to CSS ?
Style sheets are a very powerful tool for the Web site developer. They give you the chance to be completely consistent with the look and feel of your pages, while giving you much more control over the layout and design than straight HTML ever did.

What is CSS?
CSS stands for cascading stylesheets Styles define how to display HTML elements Styles are normally stored in Style Sheets Styles were added to HTML 4.0 to solve a problem External Style Sheets can save you a lot of work External Style Sheets are stored in CSS files Multiple style definitions will cascade into one.

Style Sheets Can Save a Lot of Work

Enforcing data integrity ensures the quality of the data in the database. For example, if an employee is entered with an employee_id value of 123, the database should not allow another employee to have an ID with the same value. If you have an employee_rating column intended to have values ranging from 1 to 5, the database should not accept a value of 6. If the table has a dept_id column that stores the department number for the employee, the database should allow only values that are valid for the department numbers in the company. Two important steps in planning tables are to identify valid values for a column and to decide how to enforce the integrity of the data in the column. Data integrity falls into these categories.

How to add Add External Style Sheet?

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the tag. The tag goes inside the head section:


What is Internal Style Sheet?

An internal style sheet should be used when a single document has a unique style.

What are Inline Styles?
An inline style mixes content with presentation, hence it loses many of the advantages of style sheets by mixing content with presentation. We can use this method when a style is to be applied to a single occurrence of an element. To use inline styles you have to use the style attribute in the relevant tag. The style attribute can contain any CSS property. The example shows how to change the color and the left margin of a paragraph:


This is a paragraph



When do you use CSS dimension?
The CSS dimension properties allow you to control the height and width of an element. It also allows you to increase the space between two lines.

CSS purpose and Used for?
CSS is a language, separate from HTML or XHTML CSSused to specify the layout or formatting properties of HTML elements From a single CSS file you can control an entire sites:
font type ,font and element colour ,padding ,margins ,and element positioning CSS allows developers to separate style (look, appearance,colours, fonts, layout) from the pages structure.

What are the CSS Web Template?

"CSS Web Template" is a website design created using Cascading Style Sheets (CSS) technology. Cascading stylesheets provide web developers an easy way to format and to style web pages. CSS will be used even more because it is seen the same way by all browsers, making it the best option during the browser wars.

REMOTING

What is .NET Remoting ?
         .NET Remoting is an enabler for application communication. It is a generic system for different applications to use to communicate with one another. .NET objects are exposed to remote processes, thus allowing interprocess communication. The applications can be located on the same computer, different computers on the same network, or even computers across separate networks.


.NET Remoting versus Distributed COM ?
In the past interprocess communication between applications was handled through Distributed COM, or DCOM. DCOM works well and the performance is adequate when applications exist on computers of similar type on the same network. However, DCOM has its drawbacks in the Internet connected world. DCOM relies on a proprietary binary protocol that not all object models support, which hinders interoperability across platforms. In addition, have you tried to get DCOM to work through a firewall? DCOM wants to communicate over a range of ports that are typically blocked by firewalls. There are a ways to get it to work, but they either decrease the effectiveness of the firewall (why bother to even have the firewall if you open up a ton of ports on it), or require you to get a firewall that allows support for binary traffic over port 80. .NET Remoting eliminates the difficulties of DCOM by supporting different transport protocol formats and communication protocols. This allows .NET Remoting to be adaptable to the network environment in which it is being used.

What is Channels ?
Remote objects are accessed through Channels. Channels physically transport the messages to and from remote objects. There are two existing channels TcpChannel and HttpChannel. Their names give away the protocols that they use. In addition, the TcpChannel or HttpChannel can be extended, or a new channel created if you determine the existing channels do not meet your needs.

Security in Remoting ?
Security is of paramount importance to any distributed application. Although the .NET Remoting infrastructure does not define any security features itself, because distributed applications are managed code they have full access to all of the .NET security features. In addition, the HTTP channel, when used with IIS, allows you to take full advantage of the authentication and authorization features that are available to Web based protocols. If you choose to use a protocol other than HTTP with IIS, then you have the opportunity to create your own security infrastructure.

Advantage of Remoting over Web Services ?
         .NET Remoting is a distributed objects infrastructure. It allows processes to share objects—to call methods on and access properties of objects that are hosted in different application domains within the same process, different processes executing on the same computer, on computers on an intranet, or on computers distributed over wide areas. .NET Remoting supports many different communications protocols, including the SOAP/HTTP protocol used by ASP.NET Web services. Support for other protocols makes it possible to provide much faster communications in .NET Remoting than would be possible with ASP.NET Web services. The ASP.NET programming model is tied specifically to IIS, and is limited to creating Web services that use the producer/consumer model. .NET Remoting, on the other hand, can share objects from any type of application.


The .NET Remoting system, as an integral part of the .NET Framework, supports full .NET type system fidelity. You can pass any object across the wire to a client. This is in contrast to ASP.NET, which is limited to data types that can be expressed with WSDL and XSD.


Scope of publication ?
         .NET Remoting exposes objects to other application domains as if they are local, with a few exceptions. The two exceptions most likely to trip you up are:

Static members are never remoted. Remoting always deals with some form of object instance member.
Private methods are never remoted. You cannot wrap and pass a delegate to a private method. This includes remote event handlers.
The other exceptions are less likely to cause you trouble. The online documentation provides a complete list and explanation of the exceptions.


What are the Proxies ?
         In the general sense, a proxy is any object that stands in for another, either servicing requests directly or passing the requests on to the object for which it is standing in. In .NET Remoting, the proxy manages the marshaling process and the other tasks required to make cross-boundary calls. The .NET Remoting infrastructure automatically handles creation and management of proxies, although it is possible to create your own proxy classes to plug in to and customize proxy creation, marshaling, and other proxy-related tasks.


What is Abstract ?
.NET Remoting provides a powerful and high performance way of working with remote objects. Architecturally, .NET Remote objects are a perfect fit for accessing resources across the network without the overhead posed by SOAP based WebServices. .NET Remoting is easier to use than Java's RMI, but definately more difficult than creating a WebService.

Some Important Notes
The dependence on assembly metadata implies that client applications must understand .NET concepts. As a result, applications that make use of .NET Remoting are not interoperable with other systems. Although it's possible to write an XML Web service using .NET Remoting, it's not practical when you consider that ASP.NET is designed specifically for that task. In most cases, in order to use .NET Remoting, both the client and the server must be .NET applications. This makes .NET Remoting a poor choice if you want non-.NET clients to access your service.
Before we get into the nuts and bolts of how Remoting works and how to write programs that take advantage of it, you need to understand some basic Remoting concepts.


.NET Remoting Overview ?
.NET Remoting is very flexible. You have a wide range of communications options and activation methods, as well as full control over a distributed object's lifecycle. You can choose TCP or HTTP communications protocols on any port, using text or binary formatting. The .NET Remoting infrastructure supports server activated (single call and singleton) and client activated objects. .NET Remoting gives you many opportunities to "plug in" to the system to customize lifecycle management, marshaling, serialization, messaging, and other services.
 
 
 
 

SQL SERVER

What are the different types of Locks ?
There are three main types of locks that SQL Server
(1)Shared locks are used for operations that does not allow to change or update data, such as a SELECT statement.
(2)Update locks are used when SQL Server intends to modify a page, and later promotes the update page lock to an exclusive page lock before actually making the changes.
(3)Exclusive locks are used for the data modification operations, such as UPDATE, INSERT, or DELETE.


What Is Database ?
A database is similar to a data file in that it is a storage place for data. Like a data file, a database does not present information directly to a user; the user runs an application that accesses data from the database and presents it to the user in an understandable format.Database systems are more powerful than data files in that data is more highly organized. In a well-designed database, there are no duplicate pieces of data that the user or application must update at the same time. Related pieces of data are grouped together in a single structure or record, and relationships can be defined between these structures and records.When working with data files, an application must be coded to work with the specific structure of each data file. In contrast, a database contains a catalog that applications use to determine how data is organized. Generic database applications can use the catalog to present users with data from different databases dynamically, without being tied to a specific data format. A database typically has two main parts: first, the files holding the physical database and second, the database management system (DBMS) software that applications use to access data. The DBMS is responsible for enforcing the database structure, including: · Maintaining relationships between data in the database. Ensuring that data is stored correctly, and that the rules defining data relationships are not violated. · Recovering all data to a point of known consistency in case of system failures.

what is Relational Database ?
Although there are different ways to organize data in a database, relational databases are one of the most effective. Relational database systems are an application of mathematical set theory to the problem of effectively organizing data. In a relational database, data is collected into tables (called relations in relational theory). A table represents some class of objects that are important to an organization. For example, a company may have a database with a table for employees, another table for customers, and another for stores. Each table is built of columns and rows (called attributes and tuples in relational theory). Each column represents some attribute of the object represented by the table. For example, an Employee table would typically have columns for attributes such as first name, last name, employee ID, department, pay grade, and job title. Each row represents an instance of the object represented by the table. For example, one row in the Employee table represents the employee who has employee ID 12345. When organizing data into tables, you can usually find many different ways to define tables. Relational database theory defines a process called normalization, which ensures that the set of tables you define will organize your data effectively.

What is Data Integrity and it's categories ?
Enforcing data integrity ensures the quality of the data in the database. For example, if an employee is entered with an employee_id value of 123, the database should not allow another employee to have an ID with the same value. If you have an employee_rating column intended to have values ranging from 1 to 5, the database should not accept a value of 6. If the table has a dept_id column that stores the department number for the employee, the database should allow only values that are valid for the department numbers in the company. Two important steps in planning tables are to identify valid values for a column and to decide how to enforce the integrity of the data in the column. Data integrity falls into these categories:
1) Entity integrity
2) Domain integrity
3) Referential integrity
4) User-defined integrity


Entity Integrity: Entity integrity defines a row as a unique entity for a particular table. Entity integrity enforces the integrity of the identifier column(s) or the primary key of a table (through indexes, UNIQUE constraints, PRIMARY KEY constraints, or IDENTITY properties).
Domain Integrity: Domain integrity is the validity of entries for a given column. You can enforce domain integrity by restricting the type (through data types), the format (through CHECK constraints and rules), or the range of possible values (through FOREIGN KEY constraints, CHECK constraints, DEFAULT efinitions, NOT NULL definitions, and rules).

Referential Integrity: Referential integrity preserves the defined relationships between tables when records are entered or deleted. In Microsoft® SQL Server™ 2000, referential integrity is based on relationships between foreign keys and primary keys or between foreign keys and unique keys (through FOREIGN KEY and CHECK constraints). Referential integrity ensures that key values are consistent across tables. Such consistency requires that there be no references to nonexistent values and that if a key value changes, all references to it change consistently throughout the database. When you enforce referential integrity, SQL Server prevents users from:

· Adding records to a related table if there is no associated record in the primary table.
· Changing values in a primary table that result in orphaned records in a related table.
· Deleting records from a primary table if there are matching related records.

For example, with the sales and titles tables in the pubs database, referential integrity is based on the relationship between the foreign key (title_id) in the sales table and the primary key (title_id) in the titles table.

User-Defined: Integrity User-defined integrity allows you to define specific business rules that do not fall into one of the other integrity categories. All of the integrity categories support user-defined integrity (all column- and table-level constraints in CREATE TABLE, stored procedures, and triggers).


SQL Server runs on which TCP/IP port and From where can you change the default port?
SQL Server runs on port 1433 but we can also change it for better security and From the network Utility TCP/IP properties -->Port number.both on client and the server.

What is the use of DBCC commands?

DBCC stands for database consistency checker. We use these commands to check the consistency of the databases, i.e., maintenance, validation task and status checks.DBCC CHECKDB - Ensures that tables in the db and the indexes are correctly linked.and DBCC CHECKALLOC To check that all pages in a db are correctly allocated. DBCC SQLPERF - It gives report on current usage of transaction log in percentage. DBCC CHECKFILEGROUP - Checks all tables file group for any damage.

What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?

Having Clause is basically used only with the GROUP BY function in a query. WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

When do you use SQL Profiler?

SQL Profiler utility allows us to basically track Connections to the SQL Server and also determine activities such as which SQL Scripts are running, failed jobs etc.

Can you explain the role of each service?
SQL SERVER - is for running the databases SQL AGENT - is for automation such as Jobs, DB Maintenance, Backups DTC - Is for linking and connecting to other SQL Servers.

What is Normalization ?
The logical design of the database, including the tables and the relationships between them, is the core of an optimized relational database. A good logical database design can lay the foundation for optimal database and application performance. A poor logical database design can impair the performance of the entire system.

Normalizing a logical database design involves using formal methods to separate the data into multiple, related tables. A greater number of narrow tables (with fewer columns) is characteristic of a normalized database. A few wide tables (with more columns) is characteristic of an nonnomalized database. Reasonable normalization often improves performance. When useful indexes are available, the Microsoft® SQL Server™ 2000 query optimizer is efficient at selecting rapid, efficient joins between tables.


Some of the benefits of normalization include:
·Faster sorting and index creation.
·A larger number of clustered indexes. For more information, Narrower and more compact indexes.
·Fewer indexes per table, which improves the performance of INSERT, UPDATE, and DELETE statements.
·Fewer null values and less opportunity for inconsistency, which increase database compactness.

As normalization increases, so do the number and complexity of joins required to retrieve data. Too many complex relational joins between too many tables can hinder performance. Reasonable normalization often includes few regularly executed queries that use joins involving more than four tables.

Sometimes the logical database design is already fixed and total redesign is not feasible. Even then, however, it might be possible to normalize a large table selectively into several smaller tables. If the database is accessed through stored procedures, this schema change could take place without affecting applications. If not, it might be possible to create a view that hides the schema change from the applications.


Can you tell me the difference between DELETE &TRUNCATE commands?

Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.

VB.NET QUESTIONS

What is DataType conversion in VB.NET ?
Convert one variable type to another one is called datatype conversion we can also caleed this casting in VB.NET some automatically conversion is also there.
Cbool CByte CChar Cdate CDec CDbl CInt CLng CObj CShort CSng CStr CType Asc.

What do u mean by Redim in VB.NET ?
In vb.net we use Redim and erase to manipulate Array. Once we declare an array the size set to array its makes limited to that range but with the help of redim we used to change the array size.
Redim arr(6)
we can also used preserve to save these values.
Redim Preserve arr(6)

What is branching logic control in vb.net ?
Function and subroutines are the answer.The diffrence in two of them is function send information back from where it is called means function can return a value but subroutines can not do this.

Write the role of New keyword ?
New is used to initialize a new object. We sets a variable to any dattype with help of New keyword .The New keyword gives a value to the variable.We can also uses new keyword to initialize an object variable.
Example:- dim obj as new SqlDataAdapter.

WEB SERVICES

Define Protocols that helps Web Services ?

From my point of view Web Services used three protocols for interacting with the clients.Http-Post,Http-Get,SOAP.

Explain functioning of Web Services Protocols ?
Http-Get:- This is standard protocol that helps client to communicate with server with HTTP.When client send a request to server via HTTP request and reuired parameter are attached with the querystring.Example:-
http://www.dotnetquestion.info/dotnet/interview.aspx?id=pervej&cast=munjal and we get the value from querystring.
Request.querystring("id")
Request.querystring("cast").

Http-Post:-This is same as Http-Get but the diffrence is that in place of sending parameters onto the URL information is send with HTTP request message with some extra information which contains Parameters and their values.This Protocols is limited to sending name/value pairs.

SOAP:-The only diffrence is that its relies on the XML as compares to Http-Get,Http-Post.SOAP can send not only the name/value pairs but also some complex object also as for example datatypes,class,objects.SOAP can also uses request/reponse model as Http-Get,Http-post but it is not limited to Request/Response it can also send types of message.Because its uses XML that is pure text so firewalls not created so much problem because its easily converted in to HTML. .


Why do some web service classes derive from System.Web.WebServices while others do not ?
Those Web Service classes which employ objects like Application, Session, Context, Server, and User have to derive from System.Web.WebServices. If it does not use these objects, it is not necessary to be derived from it.

What is WSDL ?
WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). (Source: www.w3.org).

What is the standard you use to wrap up a call to a Web service ? A: HTTP with SOAP.

Explain Web Services ?
         Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension..


What are VSDISCO files ?
VSDISCO files are DISCO files that enable dynamic discovery of Web Services. ASP.NET links the VSDISCO to a HTTP handler that scans the host directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document. A client who requests a VSDISCO file gets back what appears to be a static DISCO document.

What is UDDI ?
UDDI stands for Universal Description, Discovery, and Integration. It is like an "Yellow Pages" for Web Services. It is maintained by Microsoft, IBM, and Ariba, and is designed to provide detailed information regarding registered Web Services for all vendors. The UDDI can be queried for specific Web Services.

Is it possible to generate the source code for an ASP.NET Web service from a WSDL ?
The Wsdl.exe tool (.NET Framework SDK) can be used to generate source code for an ASP.NET web service with its WSDL link.
Example: wsdl /server http://api.google.com/GoogleSearch.wsdl.

Can you give an example of when it would be appropriate to use a web service as opposed to a non-serviced .NET component ?
When to Use Web Services:
(i)Communicating through a Firewall When building a distributed application with 100s/1000s of users spread over multiple locations, there is always the problem of communicating between client and server because of firewalls and proxy servers. Exposing your middle tier components as Web Services and invoking the directly from a Windows UI is a very valid option.

(ii)Application Integration When integrating applications written in various languages and running on disparate systems. Or even applications running on the same platform that have been written by separate vendors.

(iii)Business-to-Business Integration This is an enabler for B2B intergtation which allows one to expose vital business processes to authorized supplier and customers. An example would be exposing electronic ordering and invoicing, allowing customers to send you purchase orders and suppliers to send you invoices electronically.

(iv)Software Reuse This takes place at multiple levels. Code Reuse at the Source code level or binary componet-based resuse. The limiting factor here is that you can reuse the code but not the data behind it. Webservice overcome this limitation. A scenario could be when you are building an app that aggregates the functionality of serveral other Applicatons. Each of these functions could be performed by individual apps, but there is value in perhaps combining the the multiple apps to present a unifiend view in a Portal or Intranet.

What are Service Oriented Architectures (SOA) ?
SOA describes an information technology architecture that enables distributed computing environments with many different types of computing platforms and applications. Web services are one of the technologies that help make SOAs possible. As a concept, SOA has been around since the 1980s, but many early IT technologies failed to achieve the goal of linking different types of applications and systems. By making early investments with .NET, Microsoft has helped provide the building blocks that today are putting many enterprise customers on the path to successfully implementing SOAs. With SOAs, companies can benefit from the unimpeded flow of information that is the hallmark of connected systems.

What is .NET Passport ?
         .NET Passport is a Web-based service that is designed to make signing in to Web sites fast and easy. Passport enables participating sites to authenticate a user with a single set of sign-in credentials, alleviating the need for users to remember numerous passwords and user names.
 
 

XML - XHTML

What is XML ?

XML is the Extensible Markup Language. It improves the functionality of the Web by letting you identify your information in a more accurate, flexible, and adaptable way.
It is extensible because it is not a fixed format like HTML (which is a single, predefined markup language). Instead, XML is actually a metalanguage—a language for describing other languages—which lets you design your own markup languages for limitless different types of documents. XML can do this because it's written in SGML, the international standard metalanguage for text document markup (ISO 8879).

What is DOM?
Document Object Model (DOM) is a W3C specification that defines a standard (abstract) programming API to build, navigate and update XML documents. It is a "tree-structure-based" interface. As per the DOM specification, the XML parsers (such as MSXML or Xerces), load the entire XML document into memory, before it can be processed. XPath is used to navigate randomly in the document, and various DOM methods are used to create and update (add elements, delete elements, add/remove attributes, etc.) the XML documents.

What is XPath?
XML Path Language (XPath) is a W3C specification that defines syntax for addressing parts of XML document. XML document is considered as a logical tree structure, and syntax based on this consideration is used to address elements and attributes at any level in the XML document. For example, considering the XML document described above in answer to question 2, /abc:Employees/abc:Emp/@EmpID XPath expression can be used to access the EmpID attribute under the (first) Emp element under the Employees document element. XPath is used in various other specifications such as XSLT.

What is XHTML?
Is simple words, XHTML, or Extensible HTML, is HTML 4 with XML rules applied to it (each begin tag must have an end tag, attribute values in single/double quotes, etc.). However, the overall vision of XHTML is much more than that. In addition to using XML syntax for HTML, XHTML also encloses specifications such as XHTML Basic (minimal set of modules for devices such as PDAs), XForms (represents the next generation of forms for the Web, and separates presentation, logic, and data), XML Events (provides XML languages with the ability to uniformly integrate event listeners and associated event handlers), etc.

What is XML Parser ?
Microsoft's XML parser is a COM component that comes with Internet Explorer 5 and higher. Once you have installed Internet Explorer, the parser is available to scripts.
Microsoft's XML parser supports all the necessary functions to traverse the node tree, access the nodes and their attribute values, insert and delete nodes, and convert the node tree back to XML.

To create an instance of Microsoft's XML parser with JavaScript, use the following code:
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")

To create an instance of Microsoft's XML parser with VBScript, use the following code:
set xmlDoc=CreateObject("Microsoft.XMLDOM")

To create an instance of Microsoft's XML parser in an ASP page (using VBScript), use the following code:
set xmlDoc=Server.CreateObject("Microsoft.XMLDOM")

The following code loads an existing XML document ("note.xml") into Microsoft's XML parser:


Some Limitation or Disadvantage of XML?
XML markup has a few disadvantages:
It can be verbose unless element and attribute names are chosen with care. In large documents the markup overhead need not be large, but in short messages it can be significantly more than the actual data, especially when the element or attribute names are concocted by machine.

Overlapping markup is not permitted (an element cannot start inside one element and end inside another): element markup must nest hierarchically.

How to add in XML document through XSL ?
XSL (the eXtensible Stylesheet Language) is far more sophisticated than CSS. One way to use XSL is to transform XML into HTML before it is displayed by the browser as demonstrated in these examples:
Below is a fraction of the XML file. The second line,
, links the XML file to the XSL file:




Belgian Waffles
$5.95

two of our famous Belgian Waffles

650



How do I convert my existing HTML documents into XML?
Tidy is a command-line utility which runs on a wide variety of operating systems; it uses various command-line switches (parameters) to control its processing. At a minimum, it simply cleans up your HTML by ensuring that elements are properly nested and so on; it also warns you if your HTML uses non-standard code that's likely to cause cross-browser compatibility problems. One of the most useful command-line options is -asxml ("as XML," see?), which does what you seem to be asking. It will properly balance elements, per usual, but it also adds some extra information to the document. For instance, it tacks on an XML declaration, , and a statement, which unambiguously mark this as an XML document. To the root html element it also adds a namespace-declaring attribute that identifies all elements in the document as conforming to the specific XML vocabulary known as XHTML. It even forces all element names to lowercase, since the XHTML standard requires it.

If you're asking about converting HTML to a less generic form of XML than XHTML, your task may turn out to be quite complex. For example, if you've been using HTML to mark up customer invoices, not only the customer's name but also their number, item(s) ordered, quantity, and price are probably all wrapped up inside

and

tags. How do you know which "kind of paragraph" contains a given kind of information, so you can turn one instance of the p element into a custname element, another into custnumber, another into price, and so on? If you've been using CSS for styling your HTML, you may have supplied the different p elements with class="custname" (etc.) attributes and so on; if that's the case, you may be able to generate meaningful XML using an XSLT stylesheet. There may also be customized software to do the sort of conversion you want. Otherwise you're probably looking down the barrel of an ugly gun.


What is a schema? What are the limitations of a DTD?
SCHEMA is nothing but METADATA. The schema holds all the information of the xml file that is to be deployed in the project. Metatdata is nothing about data about data since we know that xml is used for data representation language we will be able to understand what metadata is. Metadata includes the tags that is going to be exchanged to and fro from another xml file. DTD (DATA TYPE DEFINITION ) which supervises two conditions namely well formedness and closeness of the xml file. So the user should be aware of what tags he was put into use of this xml file 'A' should be intimated to another application's XML file 'B', by then our xml file will interact with the another xml file, this is the major limitat ion and mandatory issue that the developers should follow.

No comments: