Friday, March 28, 2008

Question for Dot Net Interview (Part 6):

--* What is the difference between Dataset.clone() and Dataset.copy()?
1) Dataset.clone() --> Copy only structure (Returns a DataSet with the same structure (tables andrelationships) but no data.)
2) Dataset.copy() --> Copy Structure & Data Both (Returns an exact duplicate of the DataSet, with the same set of tables, relationships, and data.)

--* What is the difference between autopostback and ispostback?
1) Autopostback - Property of the control
2) IsPostback - Property of the Page class

--* What is the difference between ExcuteQuery and ExcuteNonQuery ?
1) ExcuteQuery used with select statement
2) ExcuteNonQuery used with insert ,update ,delete statement
3) ExcuteNonQuery return number of row affected
4) ExcuteQuery return one or more row of data

--* What is Tracing :
Trace in ASP.Net is nothing but to trace error and It will also give some details of the error, so that the user can easily debug the code.

--* Types of Tracing :
1) Application Level Tracing
2) Page Level Tracing

--* Different types of style sheets:
1) External
2) Inline

--* Viewstate : stores the state of controls in HTML hidden fields.

--* Can we run asp.net apllication without WEB.CONFIG file?
YES , Because all the configuration settings will be available under MACHINE.CONFIG file

--* Session state is global to your entire application for the current user. Session state can be lost in several ways:
1) If the user closes and restarts the browser.
2) If the user accesses the same page through a different browser window, although the session will still exist if a web page is accessed through the original browser window. Browsers differ on how they handle this situation.
3) If the session times out because of inactivity. By default, a session times out after 20 idle minutes.
4) If the programmer ends the session by calling Session.Abandon().

--* A transactionis:- a set of operations that must either succeed or fail as a unit. The goal of a transaction is to ensure that data is always in a valid

--* Types of Data Source in the.NET Framework:
1) SqlDataSource: This data source allows you to connect to any data source that has an ADO.NET data provider
2) ObjectDataSource: This data source allows you to connect to a custom data access class
3) XmlDataSource : This data source allows you to connect to an XML file
4) SiteMapDataSource: This data source allows you to connect to the Web.Sitemap file that describes the navigational structure of your website

--* Types of ADO.Net Data Provider:
1) System.Data.SqlClient
2) System.Data.OracleClient
3) System.Data.OleDb
4) System.Data.Odbc

--* What are types of sub queries :
1) Single row subquery
2) Multiple row subquery
3) Multiple column subquery

--* What command do we use to rename a Database sp_renamedb ‘oldname’ , ‘newname’

--* What is the command that we use to install IIS after you installed ASP.NET aspnet_regsql -i

--* What is the purpose of @@Identety:
Returns the last identity value inserted as a result of the last INSERT or SELECT INTO statement.

--* Describe the difference between inline code and code behind.
1) Inline code written along side the html in a page.
2) Code-behind is code written in seprate file and refrenced by .aspx in page.

--* What is the difference between System.Array.CopyTo and System.Array.Clone in .NET?
1) The Clone() method returns a new array object containing all the elements in the original array.
2) The CopyTo() method copies the elements into another existing array.

--* What is Encapsulation?
Encapsulation - is the ability of an object to hide its data and methods from the rest of the world. It is one of the fundamental principles of OOPs

--* Who is a protected class-level variable available to?
It is available to any sub-class (a class inheriting this class).

--* Describe the accessibility modifier “protected internal”.
It is available to classes that are within the same assembly and derived from the specified base class

--* What’s the difference between the Debug class and Trace class?
1) Use Debug class for debug builds,
2) use Trace class for both debug and release builds

--* Explain the differences between public, protected, private and internal.
1) Public: Allows class, methods, fields to be accessible from anywhere i.e. within and outside an assembly.
2) Private: When applied to field and method allows to be accessible within a class.3) Protected: Similar to private but can be accessed by members of derived class also.
4) Internal: They are public within the assembly i.e. they can be accessed by anyone within an assembly but outside assembly they are not visible.

--* List the event handlers that can be included in Global.asax?
1) Application start and end event handlers
2) Session start and end event handlers
3) Per-request event handlers
4) Non-deterministic event handlers

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

--* What is constructor.
Constructor is a method in the class which has the same name as the class It initialises the member attributes whenever an instance of the class is created.

--* What is difference between CHAR and VARCHAR:
1) CHAR pads blank spaces to the maximum length.
2) VARCHAR2 does not pad blank spaces.
3) For CHAR the maximum length is 255 and 2000 for VARCHAR

--* What are the four types of events ?
1. System Events.
2. Control Events
3. User Events
4. Other Events

--* How many Global.asax files can an Application have?
Only one Global.asax file and it’s placed in the virtual directory’s root

--* What is a session?
A user accessing an application is known as a session.

--* Different between Local and Global Variable:
1) A variable is global if it is declared outside of the main program block and not within a function
2) A variable is local if it is declared between the function declaration
3) Global variables are visible and available to all statements in a setup script that follow its declaration
4) Local variables are visible and available only within the function where they are declared.

--* Difference Between EXE and DLL file :
1) Exe is the Application
2) DLL is the Component
3) Exe can execute on its own
4) DLL Can not execute on its own
5) EXE can run independently
6) DLL will run within an Exe
7) EXE is an out-process file
8) DLL is an in-process file

--* Difference between Strong and Weak type
1) Strong type: Checking the types of variables at compile time
2) Weak type: Checking the types of variables at run time.

--* Difference between Function and Stored Procedure:
1) Function returns only one Value
2) Stored Procedure can return many value or not return
3) Functions Must return a value, procedures doesn't need to
4) Functions can be used within a Stored Procedure but stored procedures cannot be used within a function

--* How to kill session?
use session.abandont method

--* What are the different types of cookies
1) Persistent Cookies.
2) Non Persistent CookiesPersistent cookies are those which is storing in cookies folder in hard disk.Non persistent cookies is created on memory, inside the browser process. When we close the browser, that memory region will collect by Operating system, and the cookie will also deleted.

--* Write the HTML for a hyperlink that will send mail when the user clicks the link.
Send mail

No comments: