Posts

ASP.Net Page Life Cycle

Understanding the Pagelife cycle is important to develop ASP.Net application. The general Page Life Cycle Stages are: 1. Page request - Here Page is requested by the user. 2. Start – Sets the properties such as Request, Response, IsPostBack and UICulture. 3. Page initialization - Controls on the page are available and each control's UniqueID property is set. 4. Load – Controls are loaded here if it is a PostBack request. 5. Validation – Sets the IsValid property. 6. Postback Event handling – Event handlers will be called if it is PostBack. 6. Rendering - the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream of the page's Response property. 7. Unload - Unload is called after the page has been fully rendered, sent to the client, and is ready to be discarded. Common life cycle Events: 1. PreInit – Start event of the Page life cycle and here every page controls are initialized. 2. Init – This is used to read or initia...

Difference between ASP.NET and ASP

ASP - Code Render Block - Request/Response - Session - weren't transferable across servers - Built on top of the Windows and IIS, it was always a separate entity and its functionality was limited. ASP.NET - Code Declaration Block - Compiled - Event Driven - Object Oriented - Constructors/Destructors, Inheritance, Overloading. - Exception Handling - Try, Catch, Finally - Down-level Support - Cultures - User Controls - In-built client side validation - It can span across servers, it can survive server crashes, can work with browsers that don't support cookies. - Its an integral part of OS under the .NET framework. It shares many of the same objects that traditional applications would use, and all .NET objects are available for ASP.NET's consumption. - Garbage Collection - Declare variable with datatype - In built graphics support - Cultures

What is Abstraction?

Ans 1:- Abstraction is a process by which concepts are derived from the usage and classification of literal ("real" or "concrete") concepts, first principles, or other methods. "An abstraction" is the product of this process – a concept that acts as a super-categorical noun for all subordinate concepts, and connects any related concepts as a group, field, or category. Abstractions may be formed by reducing the information content of a concept or an observable phenomenon, typically to retain only information which is relevant for a particular purpose. For example, abstracting a leather soccer ball to the more general idea of a ball retains only the information on general ball attributes and behavior, eliminating the other characteristics of that particular ball. ============================== ======================= Ans 2:- Abstraction (from the Latin abs, meaning away from and trahere, meaning to draw) is the process of taking away or removing characterist...

What is Data Hiding?

Data hiding is a characteristic of object-oriented programming. Because an object can only be associated with data in predefined classes or templates, the object can only "know" about the data it needs to know about. There is no possibility that someone maintaining the code may inadvertently point to or otherwise access the wrong data unintentionally. Thus, all data not required by an object can be said to be "hidden."

What is encapsulation?

In general, encapsulation is the inclusion of one thing within another thing so that the included thing is not apparent. Decapsulation is the removal or the making apparent a thing previously encapsulated. 1) In object-oriented programming, encapsulation is the inclusion within a program object of all the resources need for the object to function - basically, the methods and the data. The object is said to "publish its interfaces." Other objects adhere to these interfaces to use the object without having to be concerned with how the object accomplishes it. The idea is "don't tell me how you do it; just do it." An object can be thought of as a self-contained atom. The object interface consists of public methods and instantiated data.

Difference between Dataset and Datareader?

-->Data Set is a connectionless service and Data reader is a connection oriented -->service. Dataset is used to store the data, it contains collections of Datatable. -->Datareader is used to connect to the database for retrieving data. -->Data Reader - Forward only where as Dataset - Can loop through dataset. -->Data Reader - Connected Recordset where as DataSet - Disconnected Recordset -->Data Reader - Less Memory Occupying where as DataSet - It occupies more memory -->Data Reader - Only Single Table can be used where as Dataset - Datatable -->Concept allows data to be stored in multiple tables. -->Data Reader - Read only where as DataSet - Can add/update/delete using the dataset -->Data Reader - No relationship can be maintained where as DataSet - Relationship can be maintained. -->Data Reader - No Xml Storage available where as DataSet - Can be stored as XML. -->The Dataset is a core of disconnected architecture. Disconnected architecture means on...

what is sqldataadapter..

SqlDataAdapter is a part of the ADO.NET Data Provider and it resides in the System.Data.SqlClient namespace. SqlDataAdapter provides the communication between the Dataset and the SQL database. We can use SqlDataAdapter Object in combination with Dataset Object. Dim adapter As New SqlDataAdapter The SqlDataAdapter Object and DataSet objects are combine to perform both data access and data manipulation operations in the SQL Server Database. When the user perform the SQL operations like Select , Insert etc. in the data containing in the Dataset Object , it won't directly affect the Database, until the user invoke the Update method in the SqlDataAdapter. Source Code:- ============ Imports System.Data.SqlClient Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim connetionString As String Dim sqlCnn As SqlConnection Dim sqlCmd As SqlCommand Dim adapter As New SqlDataAdapter Dim ds As New DataSet Dim i As Int...