ASP ,C# ADO& SQL Prepration

Tuesday 1 March 2011


1. What methods are fired during the page load?
    Init() - when the page is instantiated
    Load() - when the page is loaded into server memory
    PreRender() - the brief moment before the page is displayed to the user asHTML,
    Unload() - when page finishes loading.

2. What is the use of @Register Directive?
     @register directive informs the compiler of any custom server control added to the page

3.How many types of Validation control are provided by asp.net?
   1.Reqired Field Validator- its used when you want the control should not be empty.
   2.Range Validator- cheks if the value in validated control in specific range.
   3.Compare Validator-Check that value in control should match the value in other control .
   4.Regular Expression Validator-Control value Match with a specific regular Expression
   5.Custom Validator-used to define user define Validation
   6.Validation Summary- Display summary of all current Validation errors.

4.Differance Between Web.config and Machine.Config?
    “Web.config” file apply settings to each web application
   “Machine.config” file apply settings to all Asp.net application .
--------------------
4. What are different types of directives in .NET?

A directive specifies how an ASP.Net page is compiled.
i) Page Directive
ii) Import Directive
iii)Implements Directive
iv) Register Directive
v) Assembly Directive
vi) OutputCache Directive
vii)Reference Directive

The Page Directive is used to assign page specific attributes used by the web forms page parser and compiler to influence how page is created.
< %@ Page Language = "VB" %>

The Import Directive is used to explicitly import a namespace on to the page.
< %@ Import Namespace = "System.Web" %>

The Implement Directive is used to implement a .Net interface in the page.
< % @ Implements Interface = "System.Web.UI.IpostBackEventHandler" %>

There are two forms of the Register Directive is used for adding user controls to the page or for adding custom server controls to the page.
< %@ Register TagPrefix = "Acme" TagName="UserControl" Src = "UserControl.ascx" %>

The Assembly Directive is used to reference an assembly directly.
< %@ Assembly Name="MyAssembly" %>
< %@ Assembly Src="MySource.vb" %>

The OutputCache Directive is used to control how the page is cached on the server.
< %@ OutputCache Duration="#ofseconds" Location="Any | Client | Downstream | Server | None" Shared="True | False" VaryByControl="controlname" VaryByCustom="browser | customstring" VaryByHeader="headers" VaryByParam="parametername" %>

The Reference Directive is used to identify a page or control that the current page should dynamically compile and link with at run time. [This allows you to dynamically add a user control to a page at run time.]

The Control Directive is used to assign control specific attributes that are used by the web forms page parser and compiler to affect how the user control is created.
< %@ Control Language = "VB" EnableViewState = "false" %>

 -------------------------------------

4. Explain about Web.Config file?

 Web.config file as it sounds like is a configuration file for the Asp.net web application. There is one web.config file for one asp.net application which configures the particular application. Web.config file is written in XML with specific tags having specific meanings


There are number of important settings that can be stored in the configuration file. Here are some of the most important configurations.

1) Database connections

2) Session States

3) Error Handling

4) Security

------------------------------
4.How many web.config file can be used with an application?

In an application you can create number of web.config file
,but they are not in same directory.
but by default only one in an application
    
5.What is Session and Application object?
    Session object store information between Http request for a particular user.
    While application object are Globle Across user.

6.What is difference between Server.Transfer and Response.Redirect?
    Server.Tranfer- Transfer the first page to second page with better performance. the data can pass through variables query string and also can retrieve from the previous page control values.
    Response.Redirect- the main difference is post previous page value cant be accessible. Here also the data can pass through server variable and string. It simply redirect the page from one page to another page.

7. What is WSDL?
WSDL(web services Description Language) is an XML-based language for describing web service and how to access them.

8. What is UDDI?
  UDDI(universal description discovery and integration) it is a platform-independent framework for describing services, discovering business, and integrating business services by using the internet.

9.What is Managed and Unmanaged code?
   Managed code- VB.Net and C# compiler create .it compiles to Intermediate languge(IL),not to Machine code that could run directly on your Computer.

Unmanaged code- what you to make before VS.Net 2002 was released. VB6, Visual C++6, 15 years old C compiler all unmanaged code .

10. What is JIT(Just in time) compiler?
      Just-in-time compiler is a compiler used to convert the common intermediate language(CIL) code into Machine Code.

11. Difference Between Datagrid , Datalist and Reapter?
      DataGrid- datagrid has built in page,sorting ans editing capabilities which are not there wit  the other two controls. So if you want user to sort,page,edit data in datagrid.
      DataList- The data list control display multiple records.
      Repeater control- the repeater control is used to display a repeated list of item that are bound to the control.

12.What is Reflection ?
     Reflection is the ability to read metadata at runtime. Using reflection it is possible to uncover the method, properties, and events of a type and invoke them dynamically, Revelation also allows us to create new type at runtime.

13.Differance between Server-side and Client-side code?
     Server Side code get executed on the web server in the response of request for any aspx.page .
     Client-side code get executed on the Client browser.

14.Explain Namespace?
     Namespace are logical groupings of names used within a program. There may be Multiple namespace in a single application code, grouped based on the identifiers use. The name of any given identifier must appear only once in its namespace.

15.what is CLR?
    Common Language Runtime (CLR) is a run-time environment that Manages the execution of .Net code and provides services like memory management, debugging, security, ect.

16. 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 protocol (SOAP) which is an application of XML.

17.What is .Net Framework?
      The .Net Framework is an environment for building deploying, and running web services and other application. It consist of three main parts. The common language runtime, Framework classes, and ASP.Net

18.What is Data binding?
     Data Binding is binding controls to data from database with data binding we can bind a control in a table from the database or we can bind table to the data grid.

19.What is “Common Type Specification”( CTS)?
      CLS defines all of the basic types that can be used in the .Net Framework and the operations performed on those type.

20. what is “Common Language Specification”(CLS)?
     CLS is the collation of the rules and constraints that every language must follow.

21.What is Serialization in .Net?
      The serialization is the process of converting the object into stream of bytes. They or used fro transport the object(via remoting).

22.What is Assembly?
     It is a single Deployable unit that contains all the information about the implementation of class, structure and information .

23.Explain the .Net  Architecture?
     Architecture of .Net is based on CLR. CLR is the Common Language runtime which as virtual machine on operating system. CLR manages execution of code right from memory allocation to garbage collection. CLR consist of CLS and CTS. Every program that is written in .Net runs on CLR . We can write code on different language which should be compliant with CLR. Language  like C# .Net, VB.Net,J#.Net are supported by CLR. All code written in such language is known as managed code. With the help of such language different types application like, console based and windows based can be written. Also it can used ADO.Net for backend connectivity.

24. What’s the difference between Response.Write() andResponse.Output.Write()?
Response.Output.Write() allows you to write formatted output. 

25. What data types do the RangeValidator control support?
Integer, String, and Date. 

26. Should user input data validation occur server-side or client-side?  Why?
All user input data validation should occur on the server at a minimum.  Additionally, client-side validation can be performed where deemed appropriate and feasable to provide a richer, more responsive experience for the user.
27. Describe the difference between inline and code behind.
Inline code written along side the html in a page. Code-behind is code written in a separate file and referenced by the .aspx page. 

28. What is the transport protocol you use to call a Web service?
SOAP (Simple Object Access Protocol) is the preferred protocol. 

29. What is ViewState?
View State allows the state of objects (serializable) to be stored in a hidden field on the page.  View State is transported to the client and back to the server, and is not stored on the server or any other external source.  ViewState is used the retain the state of server-side objects between postabacks.
30. What is Boxing and UnBoxing?
Boxing is implicit conversion of ValueTypes to Reference Types (Object) .
UnBoxing is explicit conversion of Reference Types (Object) to its equivalent ValueTypes. It requires type-casting.

31. What is the difference between Value Types and Reference Types?
Value Types uses Stack to store the data where as the later uses the Heap to store the data.

33. Explain about Global Assembly cache? GAC


The Global Assembly Cache or GAC is a machine-wide .NET assemblies cache for Microsoft's CLR platform. The approach of having a specially controlled central repository addresses the shared library concept and helps to avoid pitfalls of other solutions that lead to drawbacks like DLL hell.

34. Where the compiled dll file stored?

WebSite DLL files are compiled and stored temporarily in %YourWindowsDir%\microsoft.net\framework\v2.0.40607\Temporary ASP.NET Files 


35. what is Grabage Colletion ?

Garbage colletion is a CLR Features , which Automatically  manage memory.
  programmers forget to relese  the object while code Lazines , CLR automatically release object when they are no longer in use and reference.

     

1.OPPS in C#
1.Inheritance-  The process of creating a new class by adding some feature to an existing class is know as inheritance.
2.Abstraction- In the process of reducing the content in  order to retain only the relevant information for a particular purpose.
3.Encapsulation-In the process of hiding the irrelevant details of an object that do not contribute to its essential chartists
4. Polymorphism-Single entity playing different role or forms based upon the context(function overloading)


2. explain Static variable and  static function ?
     Static variable- static variable are used to define constants because their values can be retrieved by invoke the class without creating an object of it.
     Static function- in static function without using the object we can call the function using the class name .

3. What is value type and reference type varable?
      Value type vatable contain data.
      Where the reference type variable hold the reference to memory location data is stored.
 
4.what is Constructor and destructor?
   A constructor is a special type of method when the object is created the constructer will invoke.
   A destructor are special method that are used to relese the instace of a class from memory.

5.what is Finalize() Despose()?
    The finalize destructor is called after the last reference to an object is released from the memory.
    The Dispose method is called to release a resource such as a database connection.
6. what is Interface?
    Interface also define properties, method , and events which are know as the member of the interface.
7.what is Delegates?
   A delegate is s reference type variable, which holds the reference to a method. This reference can be changed at runtime
   1. Single-Cast Delegate- It contains reference to one method only at a time.
   2. Multicast delegate- it contains an invocation list of multiple method . in multicasting you create a single delegate that invoke multiple method. 

8.what is attributes and Reflections ?
    Reflection is used in the process of obtaining type information at runtime.
    Attributes are a simple technique for adding  metadata information and behavior to code within application

9 . how to implement a polymorphism in  .net?

Polymorphism is possibility to change behavior with objects depending of object's data type. In C# polymorphism realizes through the using of keyword virtual and override

10. Virtual funtion in c#?

Virtual functions implement the concept of polymorphism are the same as in C#, except that you use the override keyword with the virtual function implementaion in the child class. The parent class uses the same virtual keyword. Every class that overrides the virtual method will use the override keyword.


class Shape
{
    public virtual void Draw()
    {
        Console.WriteLine("Shape.Draw")    ;
    }
}

class Rectangle : Shape

{
    public override void Draw()
    {
        Console.WriteLine("Rectangle.Draw");
    }
}
 
11. What is Override in C#?
Method overriding in C# is a feature like the virtual function in C++. 
Method overriding is a feature that allows you to invoke functions (that
 have the same signatures) that belong to different classes in the same 
hierarchy of inheritance using the base class reference
 


ADO

1.. Which method do you invoke on the DataAdapter control to load your generated dataset with data?
The Fill() method.
2. Which template must you provide, in order to display data in a Repeater control?
ItemTemplate. 

3. How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate. 

4.Differance between Dataset and data Reader?
    Data reader provides forward only and read only access to data.
    Dataset object can hold more than one table from the same data source .
    Data set is a disconnected architecture while data reader is connected architecture.

5. what is dataset and data adapter?
     Dataset store a copy of data from the database table . however dataset cannot directly retrieve data from database.
     Data adapter are used to link database with datasets.

6. what is data repeater?
    Asp.net repeater is a basic container control that allows you to create custom list from any data available to the page. Asp.net page that display data need to repeat the same kinds of data over and over.

7. Types of Join ?
    1. inner join 2. outer join 3. cross join 4.equi join 5. self join

8. Explain Stored Procedure?
    A stored Procedure is a predefined sql query that is stored in the data dictionary using store procedure you can reduce the network traffic and improve performance.

9. what is Trigger?
    A trigger is a mechanism that allows you to write procedures that are automatically execute whenever an insert, update or delete statement is executed on a table or view.

10.what is normalization?
    Normalization is a scientific method of braking down complex table structures into simple table structures by using certain rules using this method you can reduce redundancy in a table.

11. What is Primary key?
     Primery key of relational table uniquely identifies each record in the table.

12. what is Candidate Key?
     A table may have more than one combination of columns that uniquely identify. The rows in a table each combination is a candidate key.

13. diff between primary key and unique key and forigen key?
       Primary key: A primary key is one which uniquely identifier a row of table this key does not allows null values and does not allow duplicate values.
      Unique key: A unique is one which uniquely identifies a row of a table it will allow a single null values.
      Forign key: A foreign key is one which will refer to a primary key of another table.

14.Difference between Delete and Truncate table commands?
     Delete operation can be rolled back ,but
     Truncate operation cannot be rolled back
     

15 . what is data view?

DataView - Just like we have Views in SQL (in our backend), we have DataView object in ADO.NET. A dataview object represents bindable, customized view of a DataTable object. Operations like Sorting, Filtering, Searching, Editing and Navigation may be performed on a DataView object. In scenarios like retrieval of a subset of data from a Datatable, we may make use of DataViews to get this data. Note that the DefaultView property of a DataTable returns the Default data view for the DataTable. In case a custom view of a DataTable has to be created on a DataView, then the RowFilter property of the DataView is set to the DefaultView.

16.What is Ispostback?

when u click on any button on the browser then a postback event generates and sends a alert mesg. to the web server and the server executes the code behind the button clicked.

17. datagrid major properties?

Sorting - Gets or sets a value indicating whether the grid can be resorted by clicking on a column header.

18. what is Cursor ?

       Cursor is a database object used by application 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 Set at one time   


19. What is Trigger ?

A Trigger is a mechanism that Allows you to Write Procedure that are Automatically Execute Whenever an insert, update or delete Statement is Execute on a table or View.


1 comments:

Post a Comment