Monday, February 16, 2009
Toll free
Indian Airlines - 1800 180 1407
Jet Airways - 1800 22 5522
SpiceJet - 1800 180 3333
Air India -- 1800 22 7722
KingFisher - 1800 180 0101
Banks
ABN AMRO - 1800 11 2224
Canara Bank - 1800 44 6000
Citibank - 1800 44 2265
Corporatin Bank - 1800 443 555
Development Credit Bank - 1800 22 5769
HDFC Bank - 1800 227 227
ICICI Bank - 1800 333 499
ICICI Bank NRI - 1800 22 4848
IDBI Bank - 1800 11 6999
Indian Bank - 1800 425 1400
ING Vysya - 1800 44 9900
Kotak Mahindra Bank - 1800 22 6022
Lord Krishna Bank - 1800 11 2300
Punjab National Bank - 1800 122 222
State Bank of India - 1800 44 1955
Syndicate Bank - 1800 44 6655
Automobiles
Mahindra Scorpio - 1800 22 6006
Maruti - 1800 111 515
Tata Motors - 1800 22 5552
Windshield Experts - 1800 11 3636
Computers/IT
Adrenalin - 1800 444 445
AMD - 1800 425 6664
Apple Computers - 1800 444 683
Canon - 1800 333 366
Cisco Systems - 1800 221 777
Compaq - HP - 1800 444 999
Data One Broadband - 1800 424 1800
Dell - 1800 444 026
Epson - 1800 44 0011
eSys - 3970 0011
Genesis Tally Academy - 1800 444 888
HCL - 1800 180 8080
IBM - 1800 443 333
Lexmark - 1800 22 4477
Marshal's Point - 1800 33 4488
Microsoft - 1800 111 100
Microsoft Virus Update - 1901 333 334
Seagate - 1800 180 1104
Symantec - 1800 44 5533
TVS Electronics - 1800 444 566
WeP Peripherals - 1800 44 6446
Wipro - 1800 333 312
xerox - 1800 180 1225
Zenith - 1800 222 004
Railways
Indian Railway General Enquiry 131
Indian Railway Central Enquiry 131
Indian Railway Reservation 131
Indian Railway All Enquiry 139
Indian Railway Railway Reservation Enquiry 1345,1335,1330
Indian Railway Centralised Railway Enquiry 1330/1/2/3/4/ 5/6/7/8/9
Couriers/Packers & Movers
ABT Courier - 1800 44 8585
AFL Wizz - 1800 22 9696
Agarwal Packers & Movers - 1800 11 4321
Associated Packers P Ltd - 1800 21 4560
DHL - 1800 111 345
FedEx - 1800 22 6161
Goel Packers & Movers - 1800 11 3456
UPS - 1800 22 7171
Home Appliances
·
· Aiwa/Sony - 1800 11 1188
· Anchor Switches - 1800 22 7979
· Blue Star - 1800 22 2200
· Bose Audio - 1800 11 2673
· Bru Coffee Vending Machines - 1800 44 7171
· Daikin Air Conditioners - 1800 444 222
· DishTV - 1800 12 3474
· Faber Chimneys - 1800 21 4595
· Godrej - 1800 22 5511
· Grundfos Pumps - 1800 33 4555
· LG - 1901 180 9999
· Philips - 1800 22 4422
· Samsung - 1800 113 444
· Sanyo - 1800 11 0101
· Voltas - 1800 33 4546
· WorldSpace Satellite Radio - 1800 44 5432
Investments/ Finance
CAMS - 1800 44 2267
Chola Mutual Fund - 1800 22 2300
Easy IPO's - 3030 5757
Fidelity Investments - 1800 180 8000
Franklin Templeton Fund - 1800 425 4255
J M Morgan Stanley - 1800 22 0004
Kotak Mutual Fund - 1800 222 626
LIC Housing Finance - 1800 44 0005
SBI Mutual Fund - 1800 22 3040
Sharekhan - 1800 22 7500
Tata Mutual Fund - 1800 22 0101
Travel
Club Mahindra Holidays - 1800 33 4539
Cox & Kings - 1800 22 1235
God TV Tours - 1800 442 777
Kerala Tourism - 1800 444 747
Kumarakom Lake Resort - 1800 44 5030
Raj Travels & Tours - 1800 22 9900
Sita Tours - 1800 111 911
SOTC Tours - 1800 22 3344
Healthcare
Best on Health - 1800 11 8899
Dr Batras - 1800 11 6767
GlaxoSmithKline - 1800 22 8797
Johnson & Johnson - 1800 22 8111
Kaya Skin Clinic - 1800 22 5292
LifeCell - 1800 44 5323
Manmar Technologies - 1800 33 4420
Pfizer - 1800 442 442
Roche Accu-Chek - 1800 11 45 46
Rudraksha - 1800 21 4708
Varilux Lenses - 1800 44 8383
VLCC - 1800 33 1262
Insurance
AMP Sanmar - 1800 44 2200
Aviva - 1800 33 2244
Bajaj Allianz - 1800 22 5858
Chola MS General Insurance - 1800 44 5544
HDFC Standard Life - 1800 227 227
LIC - 1800 33 4433
Max New York Life - 1800 33 5577
Royal Sundaram - 1800 33 8899
SBI Life Insurance - 1800 22 9090
Hotel Reservations
GRT Grand - 1800 44 5500
InterContinental Hotels Group - 1800 111 000
Marriott - 1800 22 0044
Sarovar Park Plaza - 1800 111 222
Taj Holidays - 1800 111 825
Teleshopping
Asian Sky Shop - 1800 22 1800
Jaipan Teleshoppe - 1800 11 5225
Tele Brands - 1800 11 8000
VMI Teleshopping - 1800 447 777
WWS Teleshopping - 1800 220 777
Others
Domino's Pizza - 1800 111 123
Cell Phones
·
· BenQ - 1800 22 08 08
· Bird CellPhones - 1800 11 7700
· Motorola MotoAssist - 1800 11 1211
· Nokia - 3030 3838
· Sony Ericsson - 3901 1111
Thursday, February 5, 2009
Script to query LDSI
'On Error Resume Next
Dim fso
Const ForReading = 1, ForWriting = 2 , forAppend = 8
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("Members.txt", forAppend, True)
' Determine DNS domain name.
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
' Use ADO to search Active Directory.
Set objCommand = CreateObject("ADODB.Command")
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" objCommand.ActiveConnection = objConnection
strBase = "<LDAP://" & strDNSDomain >"
' Filter on all user objects. strFilter = "(&(objectCategory=person)(objectClass=user))"
' Specify attribute values to retrieve.
strAttributes = "cn,distinguishedName,sAMAccountName,description,homeDirectory, mailnickName,mail,EmployeeNumber"
strQuery = strBase & ";" & strFilter & ";" & strAttributes & ";subtree" objCommand.CommandText = strQuery
objCommand.Properties("Page Size") = 100
objCommand.Properties("Timeout") = 30
objCommand.Properties("Cache Results") = False
Set objRecordSet = objCommand.Execute
Do Until objRecordSet.EOF
strFullName = objRecordSet.Fields("cn")
strDN = objRecordSet.Fields("distinguishedName")
strNTName = objRecordSet.Fields("sAMAccountName")
strAlias = objRecordSet.Fields("mailnickName")
strmail = objRecordSet.Fields("mail")
strId= objRecordSet.Fields("EmployeeNumber")
strHomeDir = objRecordSet.Fields("homeDirectory")
If IsNull(strHomeDir) Then
strHomeDir = "None"
Else
strHomeDir = strHomeDir
End If
f.writeline strFullName & vbtab & strDN & vbtab & strNTName & vbtab & strHomeDir & vbtab & strAlias & vbtab & strmail & vbtab & strID
objRecordSet.MoveNext
Loop
MsgBox "Done"
Work is donee :0)
Acessing Data Using Data Repeater
Data Repeater repeats the specified data-bound templates without applying any sort of additional formatting. For example, the Repeater doesn't create a table or a vertical or horizontal list of data by default. You determine the final layout of the generated markup by creating ASP.NET templates and explicitly adding markup that separates one row from the next.
HTML File
<asp:repeater id="Repeater1" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem,"AssetType")%>
</ItemTemplate>
<SeparatorTemplate>
</br>
</SeparatorTemplate>
</asp:repeater>
DataBinder.Eval method is used to declare which members of the DataItem to use in the output. The Eval method uses reflection to get the second parameter from the first. This approach typically has Container.DataItem as the first parameter, which yields a DataRowView. The second parameter is the name of the data field within the DataRowView
Code behind (Using Data Reader)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Objconn As New OleDbConnection
Dim objreader As OleDbDataReader
Dim strsql As String
Dim strconnection As String
''Connection String from web.config file
strconnection = ConfigurationSettings.AppSettings("Dbconn")
Objconn = New OleDb.OleDbConnection(strconnection)
Objconn.Open()
Dim ds As DataSet = New DataSet
strsql = " Select distinct AssetType as AssetType from AM_AssetType order by assettype"
Dim objcommand As New OleDbCommand(strsql, Objconn)
objreader = objcommand.ExecuteReader
Repeater1.DataSource = objreader
Repeater1.DataBind()
End Sub
Code behind (Using Data Adapter)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Objconn As New OleDbConnection
Dim Objadapter As New OleDbDataAdapter
Dim Objds As New DataSet
Dim strsql As String
''Connection String from web.config file
strconnection = ConfigurationSettings.AppSettings("Dbconn")
Objconn = New OleDb.OleDbConnection(strconnection)
Objconn.Open()
Dim ds As DataSet = New DataSet
strsql = " Select distinct AssetType as AssetType from AM_AssetType order by assettype"
Objadapter = New OleDbDataAdapter(strsql, Objconn)
Objadapter.SelectCommand.CommandTimeout = 50000
Objadapter.Fill(ds)
Repeater1.DataSource = objreader
Repeater1.DataBind()
End Sub
Is Data Reader Disconnected ?
DataReader is connected. However, DataTable and DataSet are disconnected (in-memory).you can't have a new DataReader for a connection if there is another one already active.
Monday, January 26, 2009
Windows Presentation Foundation
WPF: Windows Presentation Foundation
Overview :
WPF is a tool comes as a package in Windows Vista and used to develop User interfaces effectively ,it provides several features to developer to develop dynamic data driven applications. It is used in both web based and stand alone applications.But mostly used in Web based application.
Windows Presentation Foundation (WPF) provides a set of services that can be used to extend the functionality of a common language runtime (CLR) property
Windows Presentation Foundation :
The core of WPF is a resolution-independent and vector-based implementation of graphics .
The extension of this along with Application development features like XAML(Extensible application Markup Language),Controls,databinding,Layout,2-D and 3-D graphics,animations,styles,templates,audio,video,
text, typography is WPF.
WPF reduces the amount of procedural code in application specifications.It provides us
ability to develop an application using both markup and code-behind.
Markup : Extensible Application Markup Language (XAML) markup to implement the appearance of an application
Code-behind : Managed programming languages (code-behind) to implement application behavior
The separation of logic from appearance has many advantages
Development and maintenance costs are reduced because appearance-specific markup is not tightly coupled with behavior-specific code.
Multiple design tools can be used to implement and share XAML markup, to target the requirements of the application development contributors; Microsoft Expression Blend provides an experience that suits designers, while Visual Studio 2005 targets developers
Globalization and localization for WPF applications is greatly simplified
Many application services like User Interface, fixed documents, adaptive documents, 2D and 3D drawings, animation, audio, video etc. work together in unison under WPF. Microsoft Silverlight that is based on XAML and JScript is a web based subset of WPF. Silverlight helps develop web and mobile applications with codes similar to .NET applications and the applications are similar to Flash.
XAML is Extensible Application Markup Language .It simplifies creation of UI for the .NET Framework programming model.I will explain the details of XAML and its implementation in my next Blog.
Features :
--WPF offers all graphics as Direct3D applications,animations,effects,audio and video.
--Interoperability with Win32 is supported by WPF.
--WPF supports all the standard image formats and video formats like WMV, MPEG and AVI. WPF also supports time based animations, Open Type Font features and Text rendering
--WPF supports XML Paper Specification documents. It also supports reading and writing of paginated documents.
--WPF offers many built-in controls like button, list box etc.
Instantiatiation of classes, properties, calling methods, and event handling in WPF is similar to the one we did in Vb.net (as I am familiar only in vb.net I mentioned as vb.net J ,it is as similar as C# or Visual Basic) and windows forms.
WPF includes additional constructs that enhaces properties and events they are
-Routed events
Dependency Properties
Windows Presentation Foundation (WPF) provides a set of services that can be used to extend the functionality of a common language runtime (CLR) property. Collectively, these services are typically referred to as the WPF property system. A property that is supproted by the WPF property system is known as a dependency property.
The purpose of dependency properties is to provide a way to find out the value of a property based on the value of other inputs
Dependency property identifier: A Dependency Property instance, which is obtained as a return value when registering a dependency property, and then stored as a member of a class. This identifier is used as a parameter in many of the APIs that interact with the WPF property system.
CLR "wrapper": The actual get and set implementations incorporate the dependency property identifier, thus providing the backing for the property using the WPF property system.
Routed Events
Routed events can be defined in 2 different perspectives either functionally or Technically
Functional definition: A routed event is a type of event that can invoke handlers on multiple listeners in an element tree, rather than just on the object that raised the event.
Implementation definition: A routed event is a CLR event that is backed by an instance of the Routed event class and is processed by the Windows Presentation Foundation (WPF) event system.
Binding and manipulation of application data is supported by WPF through its built-in set of data services. Data templates for controlling data presentation are also provided by WPF.
Friday, January 23, 2009
ADO.Net Overview
ADO.net objects are
Connection Objects
Connection objects are used to connect to databases. They have properties, such as
DataSource, UserID, and Password, which are needed to access a particular DataSource.
There are two kinds of connection objects in ADO.NET: SqlConnection and OleDbConnection.
Command Objects
Command objects contain the information that is submitted to a database. A
command can be a stored procedure call, an update statement, or a statement
that returns results. You can also use input and output parameters and return
values. In ADO.NET, you can use two kinds of command objects:
SqlCommand and OleDbCommand.
DataReader Objects
A DataReader is a read-only/forward-only view on the data. It provides a
simple and lightweight way of traversing through recordsets
A DataReader is returned after executing a command. It works similarly to a
recordset in ADO, allowing you to simply loop through the records.
ADO.NET includes two types of DataReader objects: the SqlDataReader for
Microsoft SQL Server™ version 7.0 (or later) data, and the OleDbDataReader
for ADO data. The DataReader object is database-specific. The behavior for
the SqlDataReader may differ from the behavior for the OleDbDataReader
and additional DataReader objects that are introduced in the future.
You use the OleDbCommand and SqlCommand objects and the
ExecuteReader method to transfer data into a DataReader.
DataSet Objects
The DataSet is designed to handle the actual data from a data store. The
DataSet provides a rich object model to work with when passing data between
various components of an enterprise solution. The DataSet object is generic.
The behavior of a DataSet is completely consistent regardless of the underlying
database, SQL or OLE DB.
The DataSet object represents a cache of data, with database-like behavior. It
contains tables, columns, relationships, constraints, and data. Data coming from
a database, an XML file, code, or user input can be entered into DataSet
objects and converted into files, forms, or databases. As changes are made to
the DataSet, they are tracked in a way similar to the way changes are tracked in
a word processing document.
The DataSet object has a collection of DataTable objects. A DataTable
represents one table of in-memory data. It contains a collection of columns that
represents the table's schema. A DataTable also contains a collection of rows,
representing the data contained in the table.
You use the OleDbDataAdapter and SqlDataAdapter objects and the Fill
method to get data into a DataSet.
DataView Objects
A DataView provides a custom view of a data table. You can think of the
DataView as the equivalent of the ADO disconnected recordset, because it
contains a single view on top of the table data. You can use a DataView to
specify criteria for filtering and sorting a DataSet.
DataAdapter Object
The DataAdapter object allows for the retrieval and saving of data between a DataSet object and the source datastore. It is responsible for pulling out data from the physical store and pushing it
into data tables and relations. The DataAdapter object is also responsible for
transmitting any update, insertion, or deletion to the physical database. You can
use four command objects to make any updates: UpdateCommand,
InsertCommand, DeleteCommand, and SelectCommand.
The DataAdapter object exists in two forms: SqlDataAdapter objects and
OleDbDataAdapter objects. The data source is SQL Server for
SqlDataAdapter objects and any other OLE DB provider for
OleDbDataAdapter objects.
Difference between Recordset and Dataset
Feature----------------- Recordset-------------------------- DataSet
Number of tables-------- One table -------- -------- -------- -- Multiple tables
Relationships-------- ---- Based on join -------- -------- ------- Includes relationships
Moving through data -- Move row-by-row -------- --------Navigate via relationships
Data connections -------- Connected -------- -------- -------Disconnected
Transmitting data ---------COM marshalling -------- ---------- Transmit XML file
NameSpaces required for ADO.Net
Namespace ---------------------------------------Contains
System.Data ---------------------------------------Base objects and types for ADO.NET
System.Data.OleDb-------------------------------Managed OLE DB data store objects
System.Data.SqlClient -------------------------- SQL Server specific implementations of ADO.NET objects
System.Data.XML ------------------------------ XML objects
System.Data.SqlTypes ------------------------- SQL data types
Garbage Collection
The runtime manages application threading, providing application memory isolation. When objects are no longer used by a .NET application, the runtime performs garbage collection, which frees up the memory that was used by those objects. NET uses the information in the metadata to trace the object graph and detect the objects that need to be garbage collected. Objects that are not reachable from the root are referred to as garbage objects and are marked for garbage collection.
It prevents memory leaks caused by the application that do not release all resources.
We should import System.GC Namespace to implement any garbage collector methods manully in the code.
Garbage collector is applicable only for the managed code.
Some of the methods of Garbage Collector.
GC.Collect Method
Used to force a garbage collection .
GC.GetTotalMemory
returns the total number of bytes that is allocated in the managed memory
GC.KeepAlive Extends the life time of an object passed to it as a parameter
GC.ReRegisterForFinalize
re-registers an object for finalization which is sent as parameter
GC.SupressFinalize
Suppress the finalization on an object.
Friday, January 16, 2009
FAQ
String object is read only (immutable) that means string object cannot be modified .Some methods seems to modify the string object but actually they are not modifying the object but creating the new object.
String builder object is mutable ,it can modify the object by appending,removing,replacing etc.
Here when the object is modified it is refering to the same instance where as in string class a new object is creates
Performance:
Concat method of String class and Append Method of StringBuilder class both concatenate 2 strings.But the string class creates new object from existing object which allocates memory where as A StringBuilder object maintains a buffer to accommodate the concatenation of new data. New data is appended to the end of the buffer if room is available; otherwise, a new, larger buffer is allocated, data from the original buffer is copied to the new buffer, then the new data is appended to the new buffer.
2.Explain storage and performance in different Session Modes?
Storage location----------------
InProc - session kept as live objects in web server (aspnet_wp.exe)
StateServer - session serialized and stored in memory in a separate process(aspnet_state.exe). State Server can run on another machine
SQLServer - session serialized and stored in SQL server
Performance------------
InProc - Fastest, but the more session data, the more memory is consumed onthe web server, and that can affect performance.
StateServer - When storing data of basic types (e.g. string, integer, etc),in one test environment it's 15% slower than InProc. However, the cost ofserialization/deserialization can affect performance if you're storing lotsof objects.
SQLServer - When storing data of basic types (e.g. string, integer, etc),in one test environment it's 25% slower than InProc. Same warning aboutserialization as in StateServer.
Robustness-----------
InProc - Session state will be lost if the worker process (aspnet_wp.exe)recycles, or if the appdomain restarts. It's because session state isstored in the memory space of an appdomain. Read doc on when such eventswill happen.
StateServer - Solve the session state loss problem in InProc mode. Allowsa webfarm to store session on a central server. Single point of failure atthe State Server
.SQLServer - Similar to StateServer. Moreover, session state data cansurvive a SQL server restart
3. Difference between dataadapter and datareader?
Data Reader will read only one record at a time.So memory consumption will be less,it is purely connection oriented it will use connection exclusively when datareader is closed.the memory will be released on the server machine and connection will be used for any other purpose.Data Adapter acts as a mediator between dataset and database server.it will read data from the database server and places with in datasetthe manipulations on the dataset will be updated with the database server.
4.Difference between dataset and recordset?
1. Table Collection: ADO Recordset provides the ability tonavigate through a single table of information. That tablewould have been formed with a join of multiple tables andreturning columns from multiple tables. ADO.NET DataSet iscapable of holding instances of multiple tables. It has gota Table Collection, which holds multiple tables in it. Ifthe tables are having a relation, then it can be manipulatedon a Parent-Child relationship. It has the ability tosupport multiple tables with keys, constraints andinterconnected relationships. With this ability the DataSetcan be considered as a small, in-memory relational databasecache.
2. Navigation: Navigation in ADO Recordset is based on thecursor mode. Even though it is specified to be a client-sideRecordset, still the navigation pointer will move from onelocation to another on cursor model only. ADO.NET DataSet isan entirely offline, in-memory, and cache of data. All ofits data is available all the time. At any time, we canretrieve any row or column, constraints or relation simplyby accessing it either ordinarily or by retrieving it from aname-based collection.
3. Connectivity Model: The ADO Recordset was originallydesigned without the ability to operate in a disconnectedenvironment. ADO.NET DataSet is specifically designed to bea disconnected in-memory database. ADO.NET DataSet follows apure disconnected connectivity model and this gives it muchmore scalability and versatility in the amount of things itcan do and how easily it can do that.
4. Marshalling and Serialization: In COM, throughMarshalling, we can pass data from 1 COM component toanother component at any time. Marshalling involves copyingand processing data so that a complex type can appear to thereceiving component the same as it appeared to the sendingcomponent. Marshalling is an expensive operation. ADO.NETDataset and DataTable components support Remoting in theform of XML serialization. Rather than doing expensive
Marshalling, it uses XML and sent data across boundaries.
5. What are major events in GLOBAL.ASAX file ?
The Global.asax file, which is derived from the HttpApplication class, maintains a pool of HttpApplication objects, and assigns them to applications as needed.
The Global.asax file contains the following events:
Application_Init: Fired when an application initializes or is first called. It is invoked for all HttpApplication object instances.
Application_Disposed: Fired just before an application is destroyed. This is the ideal location for cleaning up previously used resources.
Application_Error: Fired when an unhandled exception is encountered within the application. Application_Start: Fired when the first instance of the HttpApplication class is created. It allows you to create objects that are accessible by all HttpApplication instances. Application_End:
Fired when the last instance of an HttpApplication class is destroyed. It is fired only once during an application's lifetime.
Application_BeginRequest: Fired when an application request is received. It is the first event fired for a request, which is often a page request (URL) that a user enters.
Application_EndRequest: The last event fired for an application request. Application_PreRequestHandlerExecute: Fired before the ASP.NET page framework begins executing an event handler like a page or Web service.
Application_PostRequestHandlerExecute: Fired when the ASP.NET page framework has finished executing an event handler.
Applcation_PreSendRequestHeaders: Fired before the ASP.NET page framework sends HTTP headers to a requesting client (browser).
Application_PreSendContent: Fired before the ASP.NET page framework send content to a requesting client (browser).
Application_AcquireRequestState: Fired when the ASP.NET page framework gets the current state (Session state) related to the current request.
Application_ReleaseRequestState: Fired when the ASP.NET page framework completes execution of all event handlers. This results in all state modules to save their current state data.
Application_ResolveRequestCache: Fired when the ASP.NET page framework completes an authorization request. It allows caching modules to serve the request from the cache, thus bypassing handler execution.
Application_UpdateRequestCache: Fired when the ASP.NET page framework completes handler execution to allow caching modules to store responses to be used to handle subsequent requests.
Application_AuthenticateRequest: Fired when the security module has established the current user's identity as valid. At this point, the user's credentials have been validated.
Application_AuthorizeRequest: Fired when the security module has verified that a user can access resources.
Session_Start: Fired when a new user visits the application Web site. Session_End: Fired when a user's session times out, ends, or they leave the application Web site.
Session_End: Fired when a user's session times out, ends, or they leave the application Web site.
6.What order they are triggered ?
They're triggered in the following order:
Application_BeginRequest .
Application_AuthenticateRequest .
Application_AuthorizeRequest .
Application_ResolveRequestCache.
Application_AcquireRequestState.
Application_PreRequestHandlerExecute.
Application_PreSendRequestHeaders .
Application_PreSendRequestContent .
<>
Application_PostRequestHandlerExecute.
Application_ReleaseRequestState .
Application_UpdateRequestCache.
Application_EndRequest.
7.How can we force all the validation control to run ?
Page.Validate
8.How can we check if all the validation control are valid and proper ?
Page.Isvalid()
9. How to disable client side script in validators?
Set EnableLcientsideScript to False
10. What is Tracing in ASP.NET ?
Tracing allows us to view how the code was executed in detail
11. How can we kill a user session ?
Session.abandon()
12. How do I sign out in forms authentication ?
FormsAuthentication.Signout()
13. If cookies are not enabled at browser end does form Authentication work?
No, it does not work.
14. What is the namespace in which .NET has the data functionality classes ?
Following are the namespaces provided by .NET for data management :-
System.data : This contains the basic objects used for accessing and storing relational data, such as DataSet,DataTable, and DataRelation. Each of these is independent of the type of data source and the way we connect to it.
System.Data.OleDB : It contains the objects that we use to connect to a data source via an OLE-DB provider, such as OleDbConnection, OleDbCommand, etc. These objects inherit from the common base classes, and so have the same properties, methods, and events as the SqlClient equivalents.
System.Data.SqlClient:
This contains the objects that we use to connect to a data source via the Tabular Data Stream (TDS) interface of Microsoft SQL Server (only). This can generally provide better performance as it removes some of the intermediate layers required by an OLE-DB connection.
System.XML
This Contains the basic objects required to create, read, store, write, and manipulate XML documents according to W3C recommendations.
15. What is difference between dataset and datareader ?
Following are some major differences between dataset and datareader :-
DataReader provides forward-only and read-only access to data, while the DataSet object can hold more than one table (in other words more than one rowset) from the same data source as well as the relationships between them.
Dataset is a disconnected architecture while datareader is connected architecture.
Dataset can persist contents while datareader can not persist contents, they are forward only.
16.What are major difference between classic ADO and ADO.NET ?
Following are some major differences between both
As in classic ADO we had client and server side cursors they are no more present in ADO.NET. Note it's a disconnected model so they are no more applicable.
Locking is not supported due to disconnected model.
All data persist in XML as compared to classic ADO where data persisted in Binary format also.
.How do you set the url of Hyperlink dynamically?
Using navigateurl property of hyperlink in code behind.
.What is resolveURL used for?
To get the relative path.
How do you get the current page name
Page.Request.Path
Get virtual path of current request from user control?
mybase.request.path
What is the main difference between Gridlayout and FlowLayout ?
GridLayout provides absolute positioning for controls placed on the page. Developers that have their roots in rich-client development environments like Visual Basic will find it easier to develop their pages using absolute positioning, because they can place items exactly where they want them. On the other hand, FlowLayout positions items down the page like traditional HTML. Experienced Web developers favor this approach because it results in pages that are compatible with a wider range of browsers. If you look in to the HTML code created by absolute positioning you can notice lot of DIV tags. While in Flow layout you can see more of using HTML table to position elements which is compatible with wide range of browsers.
Can you give a overview of ADO.NET architecture ?
The two central components of ADO.NET are : the DataSet, and the .NET Framework data provider, which is a set of components including the Connection, Command, DataReader, and DataAdapter objects.
The dataset is the core component of the disconnected architecture of ADO.NET. The DataSet is explicitly designed for data access independent of any data source. As a result it can be used with multiple and differing data sources, used with XML data, or used to manage data local to the application. The DataSet contains a collection of one or more DataTable objects made up of rows and columns of data, as well as primary key, foreign key, constraint, and relation information about the data in the DataTable objects.
The other important section in ADO.NET architecture is “Data Provider”. Data Provider provides access to datasource (SQL SERVER, ACCESS, ORACLE).In short it provides object to achieve functionalities like opening and closing connection, retrieve data and update data.
Connection object provides connectivity to a data source.
Command object enables access to database commands to return data, modify data, run stored procedures, and send or retrieve parameter information.
The DataReader provides a high-performance stream of data from the data source.
The DataAdapter provides the bridge between the DataSet object and the data source. The DataAdapter uses Command objects to execute SQL commands at the data source to both load the DataSet with data, and reconcile changes made to the data in the DataSet back to the data source Dataset object represents disconnected and cached data.
Difference between dataReader and Data Adapter
DataReader : Reads a forward-only, read-only stream of data from a data source.
DataAdapter : Populates a DataSet and resolves updates with the data source.
Explain DataSet?
The DataSet object is central to supporting disconnected, distributed data scenarios with ADO.NET
The DataSet represents a complete set of data including related tables, constraints, and relationships among the tables
The DataTableCollection
An ADO.NET DataSet contains a collection of zero or more tables represented by DataTable objects. The DataTableCollection contains all the DataTable objects in a DataSet.
A DataTable is defined in the System.Data namespace and represents a single table of memory-resident data. It contains a collection of columns represented by a DataColumnCollection, and constraints represented by a ConstraintCollection, which together define the schema of the table. A DataTable also contains a collection of rows represented by the DataRowCollection, which contains the data in the table. Along with its current state, a DataRow retains both its current and original versions to identify changes to the values stored in the row.
The DataRelationCollection
A DataSet contains relationships in its DataRelationCollection object. A relationship, represented by the DataRelation object, associates rows in one DataTable with rows in another DataTable. It is analogous to a join path that might exist between primary and foreign key columns in a relational database. A DataRelation identifies matching columns in two tables of a DataSet.
Relationships enable navigation from one table to another within a DataSet. The essential elements of a DataRelation are the name of the relationship, the name of the tables being related, and the related columns in each table. Relationships can be built with more than one column per table by specifying an array of DataColumn objects as the key columns. When a relationship is added to the DataRelationCollection, it may optionally add a UniqueKeyConstraint and a ForeignKeyConstraint to enforce integrity constraints when changes are made to related column values.
ExtendedProperties
The DataSet (as well as the DataTable and DataColumn) has an ExtendedProperties property. ExtendedProperties is a PropertyCollection where you can place customized information, such as the SELECT statement that was used to generate the resultset, or a date/time stamp of when the data was generated. The ExtendedProperties collection is persisted with the schema information for the DataSet (as well as the DataTable and DataColumn).
http://www.blogger.com/””> Check details
What are the different data providers provided by .Net framework?
.NET Framework Data Provider for SQL Server :
For Microsoft® SQL Server™ version 7.0 or later.
.NET Framework Data Provider for OLE DB:
For data sources exposed using OLE DB.
.NET Framework Data Provider for ODBC
.NET Framework Data Provider for Oracle
For Oracle data sources.
What is command builder object?
A helper object that will automatically generate command properties of a DataAdapter or will derive parameter information from a stored procedure and populate the Parameters collection of a Command object
What are the execute methods of command Object?
The Command object exposes several Execute methods you can use to perform the intended action. When returning results as a stream of data, use ExecuteReader to return a DataReader object. Use ExecuteScalar to return a singleton value. Use ExecuteNonQuery to execute commands that do not return rows.
How do you determine whether dataReader has returned rows or not?
The .NET Framework version 1.1 includes an additional property for the DataReader, HasRows, which enables you to determine if the DataReader has returned any results before reading from it.
Can I access the values return by dataReader before it is closed?
NO,You should always call the Close method when you have finished using the DataReader object.
If your Command contains output parameters or return values, they will not be available until the DataReader is closed.
Can we Handle Multiple result sets in datareader?
Yes, the DataReader provides the NextResult method to iterate through the result sets in order
Expalin briefly about DataAdapter Object?
. A DataAdapter is used to retrieve data from a data source and populate tables within a DataSet. Each .NET Framework data provider included with the .NET Framework has a DataAdapter object.
SQL Server includes a SqlDataAdapter object
OLE DB includes an OleDbDataAdapter object
The DataAdapter also resolves changes made to the DataSet back to the data source. The DataAdapter uses the Connection object of the .NET Framework data provider to connect to a data source and Command objects to retrieve data from and resolve changes to the data source.
The InsertCommand, UpdateCommand, and DeleteCommand properties of the DataAdapter are Command objects that manage updates to the data in the data source according to modifications made to the data in the DataSet.
The Fill method of the DataAdapter is used to populate a DataSet with the results of the SelectCommand of the DataAdapter. The Fill method uses the DataReader object implicitly to return the column names and types used to create the tables in the DataSet, as well as the data to populate the rows of the tables in the DataSet
Fill method automatically opens the connection the adapter using and also closes it when the job is done,which is entirely different form data reader
DataAdapter exposes 3 different events.
RowUpdating : An UPDATE, INSERT, or DELETE operation on a row (by a call to one of the Update methods) is about to begin.
RowUpdated : An UPDATE, INSERT, or DELETE operation on a row (by a call to one of the Update methods) is complete
FillError : An error has occurred during a Fill operation
The RowUpdatingEventArgs and RowUpdatedEventArgs arguments passed to the RowUpdating and RowUpdated events include: a Command property that references the Command object being used to perform the update; a Row property that references the DataRow object containing the updated information; a StatementType property for what type of update is being performed; the TableMapping, if applicable; and the Status of the operation.
Status property to determine if an error has occurred during the operation
Continue - Continue the update operation
ErrorsOccurred- Abort the update operation and throw an exception
SkipCurrentRow- Ignore the current row and continue the update operation
SkipAllRemainingRows- Abort the update operation but do not throw an exception
We use ContinueUpdateOnError property to handle errors for updated rows
DataAdapter.ContinueUpdateOnError is true, when an update to a row results in an exception being thrown the text of the exception is placed into the RowError information of the particular row and processing continues without throwing an exception. This enables you to respond to errors when the Update is complete, in contrast to the RowUpdated event that enables you to respond to errors when the error is encountered.
Explain FillError event ?
The DataAdapter issues the FillError event when the data in the row being added could not be converted to a .NET Framework type without some loss of precision.
What is the use of command objects and what are the methods provided by the command object ?
They are used to connect connection object to Datareader or dataset. Following are the methods provided by command object :-
ExecuteNonQuery :- Executes the command defined in the CommandText property against the connection defined in the Connection property for a query that does not return any row (an UPDATE, DELETE or INSERT). Returns an Integer indicating the number of rows affected by the query.
ExecuteReader :- Executes the command defined in the CommandText property against the connection defined in the Connection property. Returns a "reader" object that is connected to the resulting rowset within the database, allowing the rows to be retrieved.
ExecuteScalar :- Executes the command defined in the CommandText property against the connection defined in the Connection property. Returns only single value (effectively the first column of the first row of the resulting rowset) any other returned columns and
What are basic methods of DataAdapter ?
Fill :- Executes the SelectCommand to fill the DataSet object with data from the data source. It an also be used to update (refresh) an existing table in a DataSet with changes
made to the data in the original datasource if there is a primary key in the table in the DataSet.
FillSchema :- Uses the SelectCommand to extract just the schema for a table from the data source, and creates an empty table in the DataSet object with all the corresponding constraints.
Update:- Calls the respective InsertCommand, UpdateCommand, or DeleteCommand for each inserted, updated,or deleted row in the DataSet so as to update the original data source with the changes made to the content of the DataSet. This is a little like the UpdateBatch method provided by the ADO Recordset object, but in the DataSet it can be used to update more than one table.
What are the various objects in Dataset ?
Dataset has a collection of DataTable object within the Tables collection.
Each DataTable object contains a collection of DataRow objects and a collection of DataColumn objects. There are also collections for the primary keys, constraints, and default values used in this table which is called as constraint collection, and the parent and child relationships between the tables(DataRelationship Collection). Finally, there is a DefaultView object for each table. This is used to create a DataView object based on the table, so that the data can be searched, filtered or otherwise manipulated while displaying the data.
How do we Execute stored procedure in ADO.NET?
To execute stored procedures in .Net ,we use the command object and set the commandtype property to Stored procedure.
How to close database connection after datareader is closed ?
Command method Executereader takes a parameter called as CommandBehavior where in we can specify saying close connection automatically after the Datareader is close
objDataReader =objCommand.ExecuteReader(CommandBehavior.CloseConnection)
How do you return schema information form data reader?
Set the Parameter of ExecuteReader method of Command object to SchemaOnly.
objDataReader =objCommand.ExecuteReader(CommandBehavior.Schemaonly)
How to track the changes in dataset?
For tracking down changes Dataset has two methods
“GetChanges “and “HasChanges”.
GetChanges Returns dataset which are changed since it was loaded or since Acceptchanges was executed.
HasChanges This property indicates that dataset has any changes been made since the dataset was loaded or acceptchanges method was executed. If we want to revert or abandon all changes since the dataset was loaded use “RejectChanges”.
What are the new features of ASP.net 2.0 ?
Master Pages:
Lets you easily create pages with consistent elements such as
banners and navigation elements.
Site navigation
Provides controls that make it easy to create site navigation
Themes
Let you easily customize formatting elements like fonts and colors.
New data-access features
New data source controls and data-bound controls drastically
reduce the amount of code required for most database applications
Login
Provides controls that let you manage user logins to your web sites.
Profiles
Uses a database to store data about users between sessions.
Web parts
Lets the user choose which elements to include in a web page.
What are the new features of ASP.net 3.5 ?
Two new data access controls are included with the
ASP.NET 3.5: the ListView and DataPager controls.
The Microsoft AJAX (Asynchronous JavaScript and
XML) extensions are integrated into the ASP.NET 3.5.
AJAX represents a transition from using server-side
technologies to using client-side technologies when
building we applications. By using ASP.NET AJAX, you
can improve the user experience and the efficiency of your
Web applications.
Microsoft LINQ to SQL is a new query language that you
to access a database without writing any SQL.
Maximum Number of Colums allowed in a table
1024
Maximum number of parameters in a stored procedure
2100.

.jpg)