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
which is a simple COM object with limited facilities. ADO
What is PostBack & Callback?
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.
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
Provider, for which there is a specific OLE DB Provider, ODBC Driver, or JDBC a.NET Bridge
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).
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 ?
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.
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();
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.
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.
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.
Here, the ViewState of the controls gets saved in the form's hidden control.
In this method all controls are rendered recursively (i.e. Render method of each control is called).
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
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.
CREATE VIEW View_Name
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 ?
-A class may inherit several interfaces.
-A class may inherit only one abstract class.
-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.
-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.
-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
-Requires more time to find the actual method in the corresponding classes.
-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#?
String UserID = "dotnetquestion";
cookie = new HttpCookie("ID");
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.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:
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.
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.
What is Concurrency and its types?
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.
What are the differences between Datalist DataGrid and datarepeater ?
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.
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.
Where are shared assemblies stored ?
How can you tell the application to look for assemblies at the locations other than its own install ?
Where’s global assembly cache located on the system ?
How do you specify a custom attribute for the entire assembly (rather than for a class) ?
What is delay signing ?
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.
Server-side options are:
DOTNET PAGE LIFECYCLE ?
Automatic Memory Management ?
What Is OOPS ?
What is Constructor?
What is Abstract Class ?
What is ValueType?
What is diff. between abstract class and an interface?
COM - DCOM
Which namespace do the classes, allowing you to support COM functionality, are located?
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.
What do u mean to CSS ?
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?
CSS purpose and Used for?
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.
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.
What are the different types of Locks ?
What is Data Integrity and it's categories ?
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?
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.
What is DataType conversion in VB.NET ?
What is branching logic control in vb.net ?
Write the role of New keyword ?
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.
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.
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")
To create an instance of Microsoft's XML parser with VBScript, use the following code:
To create an instance of Microsoft's XML parser in an ASP page (using VBScript), use the following code:
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
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
andtags. 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.