Tuesday, June 21, 2011

List of 221 MS Word Short Cut Keys

1
Ctrl + Shift + A
AllCaps
Makes the selection all capitals (toggle)

2
Alt + Ctrl + 1
ApplyHeading1
Applies Heading 1 style to the selected text

3
Alt + Ctrl + 2
ApplyHeading2
Applies Heading 2 style to the selected text

4
Alt + Ctrl + 3
ApplyHeading3
Applies Heading 3 style to the selected text

5
Ctrl + Shift + L
ApplyListBullet
Applies List Bullet style to the selected text

6
Alt + F10
AppMaximize
Enlarges the application window to full size

7
Alt + F5
AppRestore
Restores the application window to normal size

8
Ctrl+B
Bold
Makes the selection bold (toggle)

9
Ctrl + PgDn
BrowseNext
Jump to the next browse object

10
Ctrl + PgUp
BrowsePrev
Jump to the previous browse object

11
Alt + Ctrl + Home
BrowseSel
Select the next/prev browse object

12
Esc
Cancel
Terminates an action

13
Ctrl+E
CenterPara
Centers the paragraph between the indents

14
Shift+F3
ChangeCase
Changes the case of the letters in the selection

15
Left arrow
CharLeft
Moves the insertion point to the left one character

16
Shift + Left arrow
CharLeftExtend
Extends the selection to the left one character

17
Rt arrow
CharRight
Moves the insertion point to the right one character

18
Shift + Rt arrow
CharRightExtend
Extends the selection to the right one character

19
Alt + Shift + C
ClosePane
Closes the active window pane (if you are in Normal View and have,
for example, the Footnote pane open)

20
Alt+Drag (or press Ctrl + Shift + F8 and drag, but Alt + Drag is
far easier!)
ColumnSelect
Selects a columnar block of text

21
Ctrl +Shift+C
CopyFormat
Copies the formatting of the selection

22
Shift + F2
CopyText
Makes a copy of the selection without using the clipboard (press
Return to paste)

23
Alt + F3
CreateAutoText
Adds an AutoText entry to the active template

24
Ctrl+ Backspace
DeleteBackWord
Deletes the previous word without putting it on the Clipboard

25
Ctrl + Del
DeleteWord
Deletes the next word without putting it on the Clipboard

26
Ctrl+W, Ctrl+F4
DocClose
Prompts to save the document and then closes the active window.
(But doesn't intercept the menu command)

27
Ctrl + F10
DocMaximize
Enlarges the active window to full size

28
Ctrl + F7
DocMove
Changes the position of the active window

29
Ctrl + F5
DocRestore
Restores the window to normal size

30
Ctrl + F8
DocSize
Changes the size of the active window

31
Alt + Ctrl + S
DocSplit
Splits the active window horizontally and then adjusts the split

32
Alt + Shift + F9
DoFieldClick
Executes the action associated with macrobutton fields

33
Ctrl + Shift + D
DoubleUnderline
Double underlines the selection (toggle)

34
Alt R, G
DrawGroup
Groups the selected drawing objects

35
Alt R, I
DrawSnapToGrid
Sets up a grid for aligning drawing objects

36
Alt R, U
DrawUngroup
Ungroups the selected group of drawing objects

37
Ctrl+Shift+F5 (Or: Alt I, K)
EditBookmark
Brings up the bookmark dialog

38
Del
EditClear
Performs a forward delete or removes the selection without putting
it on the Clipboard

39
Ctrl+C
EditCopy
Copies the selection and puts it on the Clipboard

40
Ctrl+X
EditCut
Cuts the selection and puts it on the Clipboard

41
Ctrl+F
EditFind
Finds the specified text or the specified formatting

42
F5, Ctrl+G
EditGoTo
Jumps to a specified place in the active document

43
Alt E, K
EditLinks
Allows links to be viewed, updated, opened, or removed

44
Ctrl+V
EditPaste
Inserts the Clipboard contents at the insertion point

45
Alt E, S
EditPasteSpecial
Inserts the Clipboard contents as a linked object, embedded object,
or other format

46
Alt + Shift + Backspc
EditRedo
Redoes the last action that was undone

47
F4
EditRedoOrRepeat
Repeats the last command, or redoes the last action that was undone
(unfortunately, doesn't work for as many commands in Word 2000 as in Word 97 and
below, but this is still one of Word's most useful shortcuts, if not the most
useful)

48
Ctrl+H
EditReplace
Finds the specified text or the specified formatting and replaces
it

49
Ctrl+A
EditSelectAll
Selects the entire document

50
Ctrl+Z
EditUndo
Reverses the last action

51
Alt + PageDn (to select to end of column, use Alt + Shift + PgDn)
EndOfColumn
Moves to the last cell in the current table column

52
Ctrl+Shift+End
EndOfDocExtend
Extends the selection to the end of the last line of the document

53
Ctrl+End
EndOfDocument
Moves the insertion point to the end of the last line of the
document

54
End
EndOfLine
Moves the insertion point to the end of the current line

55
Shift+End
EndOfLineExtend
Extends the selection to the end of the current line

56
Alt+End
EndOfRow
Moves to the last cell in the current row

57
Alt + Ctrl + PgDn
EndOfWindow
Moves the insertion point to the end of the last visible line on
the screen

58
Shift + Alt + Ctrl + PgDn
EndOfWindowExtend
Extends the selection to the end of the last visible line on the
screen

59
F8 (press Esc to turn off)
ExtendSelection
Turns on extend selection mode and then expands the selection with
the direction keys

60
Alt + F4 (<9>)
FileCloseOrExit
Closes the current document, or if no documents are open, quits
Word. Horrible command, as it makes it a long winded business to quit Word. But
there's a simple solution - assign Alt+F4 to FileExit instead.

61
Alt + F4 (Word 97)
FileExit
Quits Microsoft Word and prompts to save the documents (does
intercept the menu item, but not the keyboard shortcut, or the x button. An
AutoExit macro is usually a better way of intercepting this).

62
NOT Ctrl+N!!
FileNew
Creates a new document or template (brings up the dialog). Note
that: Word pretends that Ctrl+N is assigned to FileNew but it isn't, it's
assigned to FileNewDefault You can fix this in Word 2000 by assigning Ctrl+N to
the FileNewDialog command. In Word 97 the only way to fix it is to create a
macro called FileNew (to do this, press Alt + F8, type "FileNew" without the
quotes and Click "Create". The macro will automatically contain the code needed
to make it work).

63
Ctrl+N
FileNewDefault
Creates a new document based on the Normal template.

64
Ctrl+O
FileOpen
Opens an existing document or template

65
Alt F, U
FilePageSetup
Changes the page setup of the selected sections

66
Ctrl + P
FilePrint
Prints the active document (brings up the dialog)

67
Ctrl+F2
FilePrintPreview
Displays full pages as they will be printed

68
Alt F, I
FileProperties
Shows the properties of the active document

69
Ctrl+S
FileSave
FileSave

70
Alt F, A (or F12)
FileSaveAs
Saves a copy of the document in a separate file (brings up the
dialog)

71
Ctrl+Shift+F
Font
Activates the Fonts listbox on the formatting toolbar

72
Ctrl+Shift+P
FontSizeSelect
Activates the Font Size drop-down on the formatting toolbar

73
Alt + Ctrl + K
FormatAutoFormat
Automatically formats a document (or sometimes, automatically
screws it up)

74
Alt O, B
FormatBordersAndShading
Changes the borders and shading of the selected paragraphs, table
cells, and pictures

75
Alt O, E
FormatChangeCase
Changes the case of the letters in the selection

76
Alt O, C
FormatColumns
Changes the column format of the selected sections (brings up the
dialog)

77
Alt O, D
FormatDropCap
Formats the first character of current paragraph as a dropped
capital (must select it first)

78
Ctrl+D
FormatFont
Brings up the Format + Font dialog

79
Alt + Shift + R
FormatHeaderFooterLink
Links the current header/footer to the previous section (but does
not intercept the button on the Header Footer toolbar)

80
Alt O, P
FormatParagraph
Brings up the Format Paragraph dialog

81
Alt O, S
FormatStyle
Applies, creates, or modifies styles

82
Alt O, T
FormatTabs
Brings up the Format Tabs dialog

83
Shift + F5
GoBack
Returns to the previous insertion point (goes back to up to 3
points, then returns to where you started; this is one of the most useful
shortcuts of them all. Also useful when opening a document, if you want to g
straight to where you were last editing it)

84
Ctrl + >
GrowFont
Increases the font size of the selection

85
Ctrl + ]
GrowFontOnePoint
Increases the font size of the selection by one point

86
Ctrl + T (or drag the ruler)
HangingIndent
Increases the hanging indent

87
F1
Help
Microsoft Word Help

88
Shift + F1
HelpTool
Lets you get help on a command or screen region or examine text
properties

89
Ctrl + Shift + H
Hidden
Makes the selection hidden text (toggle)

90
Click on it
HyperlinkOpen
Connect to a hyperlink's address

91
Ctrl + M (or drag the ruler)
Indent
Moves the left indent to the next tab stop

92
Alt + Ctrl + M (or Alt I, M)
InsertAnnotation
Inserts a comment

93
F3
InsertAutoText
Replaces the name of the AutoText entry with its contents

94
Alt I, B
InsertBreak
Ends a page, column, or section at the insertion point

95
Alt I, C
InsertCaption
Inserts a caption above or below a selected object

96
Ctrl + Shift + Return
InsertColumnBreak
Inserts a column break at the insertion point

97
Alt + Shift + D
InsertDateField
Inserts a date field

98
Alt + Ctrl + D
InsertEndnoteNow
Inserts an endnote reference at the insertion point without
displaying the dialog

99
Alt I, F
InsertField
Inserts a field in the active document

100
Ctrl+F9
InsertFieldChars
Inserts an empty field with the enclosing field characters

101
Alt I, L
InsertFile
Inserts the text of another file into the active document

102
Alt I, N
InsertFootnote
Inserts a footnote or endnote reference at the insertion point

103
Alt + Ctrl + F
InsertFootnoteNow
Inserts a footnote reference at the insertion point without
displaying the dialog

104
Ctrl + K
InsertHyperlink
Insert Hyperlink

105
Alt I, D
InsertIndexAndTables
Inserts an index or a table of contents, figures, or authorities
into the document

106
Alt + Ctrl + L
InsertListNumField
Inserts a ListNum Field

107
Alt + Shift + F
InsertMergeField
Brings up a dialog to insert a mail merge field at the insertion
point. (It does not intercept the button on the Mail merge. toolbar)

108
Ctrl + Return
InsertPageBreak
Inserts a page break at the insertion point

109
Alt + Shift + P
InsertPageField
Inserts a page number field

110
Ctrl + Shift + F3
InsertSpike
Empties the spike AutoText entry and inserts all of its contents
into the document

111
Alt + Shift + T
InsertTimeField
Inserts a time field

112
Ctrl + I
Italic
Makes the selection italic (toggle)

113
Ctrl + J
JustifyPara
Aligns the paragraph at both the left and the right indent

114
Ctrl + L
LeftPara
Aligns the paragraph at the left indent

115
Down arrow
LineDown
Moves the insertion point down one line

116
Shift + down arrow
LineDownExtend
Extends the selection down one line

117
Up arrow
LineUp
Moves the insertion point up one line

118
Shift + up arrow
LineUpExtend
Extends the selection up one line

119
Ctrl + F11
LockFields
Locks the selected fields to prevent updating

120
Alt + Shift + K
MailMergeCheck
Checks for errors in a mail merge

121
Alt+Shift+E
MailMergeEditDataSource
Lets you edit a mail merge data source

122
Alt + Shift + N
MailMergeToDoc
Collects the results of the mail merge in a document

123
Alt Shift + M
MailMergeToPrinter
Sends the results of the mail merge to the printer

124
Alt + Shift + I
MarkCitation
Marks the text you want to include in the table of authorities

125
Alt + Shift + X
MarkIndexEntry
Marks the text you want to include in the index

126
Alt + Shift + O
MarkTableOfContentsEntry
Inserts a TC field (but it is far better to use Heading Styles to
generate your Table of Contents instead)

127
Alt or F10
MenuMode
Makes the menu bar active

128
Alt + Shift + F11
MicrosoftScriptEditor
Starts or switches to Microsoft Development Environment
application, allowing you to view the HTML/XML source code that would be behind
the document if it were in .htm format (or that is behind it if it already is in
.htm format).

129
Alt + Ctrl + F1
MicrosoftSystemInfo
Execute the Microsoft System Info application

130
F2
MoveText
Moves the selection to a specified location without using the
clipboard (press Return to execute the more)

131
Tab
NextCell
Moves to the next table cell

132
F11
NextField
Moves to the next field

133
Alt + F7
NextMisspelling
Find next spelling error

134
Alt + down arrow
NextObject
Moves to the next object on the page

135
Ctrl + F6
NextWindow
Switches to the next document window, equivalent to selecting a
document from the Window menu.

136
Ctrl+Shift+N
NormalStyle
Applies the Normal style

137
Ctrl + 0
OpenOrCloseUpPara
Sets or removes extra spacing above the selected paragraph

138
F6
OtherPane
Switches to another window pane in Normal View (for instance, if
you have if you have a Footnotes pane open in Normal view and want to switch to
the main document and back without closing the pane).

139
Alt + _
OutlineCollapse
Collapses an Outline in Outline View by one level

140
Alt+Shift+rt arrow
OutlineDemote
Demotes the selected paragraphs one heading level

141
Alt + +
OutlineExpand
Expands an Outline in Outline View by one level

142
Alt+Shift+down arrow
OutlineMoveDown
Moves the selection below the next item in the outline

143
Alt+Shift+up arrow
OutlineMoveUp
Moves the selection above the previous item in the outline

144
Alt+Shift+left arrow
OutlinePromote
Promotes the selected paragraphs one heading level

145
Alt + Shift + L
OutlineShowFirstLine
Toggles between showing the first line of each paragraph only or
showing all of the body text in the outline

146
Ins
Overtype
Toggles the typing mode between replacing and inserting

147
PgDn
PageDown
Moves the insertion point and document display to the next screen
of text

148
Shift+ PgDn
PageDownExtend
Extends the selection and changes the document display to the next
screen of text

149
PgUp
PageUp
Moves the insertion point and document display to the previous
screen of text

150
Shift + PgUp
PageUpExtend
Extends the selection and changes the document display to the
previous screen of text

151
Ctrl + down arrow
ParaDown
Moves the insertion point to the beginning of the next paragraph

152
Shift + Ctrl + down arrow
ParaDownExtend
Extends the selection to the beginning of the next paragraph

153
Ctrl + up arrow
ParaUp
Moves the insertion point to the beginning of the previous
paragraph

154
Shift + Ctrl + up arrow
ParaUpExtend
Extends the selection to the beginning of the previous paragraph

155
Ctrl+Shift+V
PasteFormat
Applies the previously copied formatting to selection

156
Shift + Tab
PrevCell
Moves to the previous table cell

157
Shift + F11
PrevField
Moves to the previous field

158
Alt + up arrow
PrevObject
Moves to the previous object on the page

159
Ctrl + Shift + F6
PrevWindow
Switches back to the previous document window

160
Sfift+F4
RepeatFind
Repeats Go To or Find to find the next occurrence

161
Ctrl+Spacebar
ResetChar
Makes the selection the default character format of the applied
style

162
Ctrl+Q
ResetPara
Makes the selection the default paragraph format of the applied
style

163
Ctrl +R
RightPara
Aligns the paragraph at the right indent

164
Ctrl + *
ShowAll
Shows/hides all nonprinting characters

165
Alt + Shift + A
ShowAllHeadings
Displays all of the heading levels and the body text in Outline
View

166
Ctrl + <
ShrinkFont
Decreases the font size of the selection

167
Ctrl + [
ShrinkFontOnePoint
Decreases the font size of the selection by one point

168
Ctrl + Shift + K
SmallCaps
Makes the selection small capitals (toggle)

169
Ctrl + 1
SpacePara1
Sets the line spacing to single space

170
Ctrl + 5
SpacePara15
Sets the line spacing to one-and-one-half space

171
Ctrl + 2
SpacePara2
Sets the line spacing to double space

172
Ctrl + F3
Spike
Deletes the selection and adds it to the "Spike" AutoText entry
(which allows you to move text and graphics from nonadjacent locations)

173
Alt + PgUp
StartOfColumn
Moves to the first cell in the current column

174
Ctrl+Shift+Home
StartOfDocExtend
Extends the selection to the beginning of the first line of the
document

175
Ctrl +Home
StartOfDocument
Moves the insertion point to the beginning of the first line of the
document

176
Home
StartOfLine
Moves the insertion point to the beginning of the current line

177
Shift+Home
StartOfLineExtend
Extends the selection to the beginning of the current line

178
Alt+Home
StartOfRow
Moves to the first cell in the current row

179
Alt+Ctrl+PgUp
StartOfWindow
Moves the insertion point to the beginning of the first visible
line on the screen

180
Shift+ Alt+Ctrl+PgUp
StartOfWindowExtend
Extends the selection to the beginning of the first visible line on
the screen

181
Strl + Shift + S
Style
Activates the Style drop-down on the Formatting toolbar

182
Ctrl + =
Subscript
Makes the selection subscript (toggle)

183
Ctrl + +
Superscript
Makes the selection superscript (toggle)

184
Ctrl + Shift + Q
SymbolFont
Applies the Symbol font to the selection

185
Alt A, F
TableAutoFormat
Applies a set of formatting to a table

186
Alt A, H
TableHeadings
Toggles table headings attribute on and off

187
Alt + click
(Alt + drag to select several)
TableSelectColumn
Selects the current column in a table

188
Click in left margin
TableSelectRow
Selects the current row in a table

189
Alt + double-click
TableSelectTable
Selects an entire table

190
Alt + Ctrl + U
TableUpdateAutoFormat
Updates the table formatting to match the applied Table Autoformat
settings

191
Shift + F9 (Alt + F9 toggles all field codes on or off)
ToggleFieldDisplay
Shows the field codes or the results for the selection (toggle)

192
Alt T, C
ToolsCustomize
Allows you to customizes the Word user interface (menus, keyboard
and toolbars) and store the customizations in a template (defaults to
Normal.dot, so be careful!)

193
Alt + F8
ToolsMacro
Runs, creates, deletes, or revises a macro

194
F7
ToolsProofing
Checks the spelling and grammar in the active document

195
Ctr.l + Shift + E
ToolsRevisionMarksToggle
Toggles track changes for the active document

196
Shift + F7
ToolsThesaurus
Finds a synonym for the selected word

197
Ctrl+U
Underline
Formats the selection with a continuous underline (toggle)

198
Ctrl + Shift + T
(or drag the ruler)
UnHang
Decreases the hanging indent

199
Ctrl + Shift + M
(or drag the ruler)
UnIndent
Moves the left indent to the previous tab stop

200
Ctrl+Shift+F9
UnlinkFields
Permanently replaces the field codes with the results

201
Ctrl + Shift + F11
UnlockFields
Unlocks the selected fields for updating

202
F9
UpdateFields
Updates and displays the results of the selected fields

203
Ctrl + Shiift + F7
UpdateSource
Copies the modified text of a linked file back to its source file

204
Hover over comment
ViewAnnotations
Show or hide the comment pane

205
Dbl-click the endnote reference
ViewEndnoteArea
If in Normal View, opens a pane for viewing and editing the endnote
(toggle). If in Page/Print Layout View, switches from the body text to the
endnote or vice versa

206
At + F9
ViewFieldCodes
Shows the field codes or results for all fields (toggle)

207
Dbl-click the footnote reference
ViewFootnoteArea
If in Normal View, opens a pane for viewing and editing the
footnote (toggle). If in Page/Print Layout View, switches from the body text to
the footnote or vice versa.

208
Alt V, F
ViewFootnotes
If in Normal View, opens a pane for viewing and editing footnotes
and endnotes (toggle). If in Page/Print Layout View, switches from the body text
to the footnotes/endnotes or vice versa.

209
Alt V, H
ViewHeader
Displays header in page layout view

210
Alt V, N
(or Alt + Ctrl + N)
ViewNormal
Changes the editing view to normal view

211
Alt V, O
(or Alt + Ctrl + O)
ViewOutline
Displays a document's outline

212
Alt V, P
(or Alt + Ctrl + P)
ViewPage
Displays the page more-or-less as it will be printed, and allows
editing (In Word 2000 the menu item is called Print Layout, but fortunately the
command hasn't changed.

213
Alt + F11
ViewVBCode
Shows the VB editing environment (Tools + Macro + Visual Basic
Editor)

214
Alt + left arrow
WebGoBack
Backward hyperlink (useful if you clicked on a page number
hyperlink in the table of contents and then want to return to the TOC)

215
Alt + rt arrow
WebGoForward
Forward hyperlink

216
Alt W, A
WindowArrangeAll
Arranges windows as non-overlapping tiles

217
Ctrl + left arrow
WordLeft
Moves the insertion point to the left one word

218
Shift + Ctrl + left arrow
WordLeftExtend
Extends the selection to the left one word

219
Ctrl + rt arrow
WordRight
Moves the insertion point to the right one word

220
Shift + Ctrl + rt arrow
WordRightExtend
Extends the selection to the right one word

221
Ctrl + Shift + W
WordUnderline
Underlines the words but not the spaces in the selection (toggle)

Code for How to Highlight Row of Gridview on Mouse Over which doesn't use alternate row color in Asp.net

In .aspx File declare OnRowCreated eventas follow.


Following code will:
Highlight Gridview which is not using alternate row color.
protectedvoid OnRowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//On Mouse Over Highlight Row
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#ffff00'");

//On Mouse out restore default row color
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
}
}

Code for How to Highlight Gridview Row on Mouse Over when gridview rows are using alternate row color in Asp.net

In .aspx File declare OnRowCreated eventas follow.


Following code will explain:
How to Highlight Gridview which uses alternate row color.

protectedvoid OnRowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//On Mouse over highlight gridview
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#ffff00'");

//On Mouse out restore girdview row color based on alternate row color//Please change this color with your gridview alternate color.

if (e.Row.RowIndex % 2 == 0)
{
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#F7F7DE'");
}
else
{
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
}
}
}

Add Google Maps to your .Net site

Ever wanted to add a Google Map to your site but only had 15 minutes to spare? Now you can add a map and still have time to brag to your mates and bask in the worship that (inevitably) comes afterward.

Basically, the guys over at subgurim.net have already done all the hard work in writing the .Net wrapper for Google Maps. Problem is, the examples on their site are mostly in spanish & its a bit difficult to find out exactly what is needed to get everything working.

But all this is cutting into your bragging time - so lets get started!

1. Get a Google Maps API key from here:
http://www.google.com/apis/maps/

2. Download the SubGurim wrapper dll from here:
http://en.googlemaps.subgurim.net/descargar.aspx

3. Unzip it, and put it in your \bin directory

4. Add it to your toolbox by
Tools -> Choose Toolbox Items -> Browse -> Select the .dll file -> OK
GMap will now be in the ‘Standard’ area of your Toolbox.

5. Add a new webpage.

6. Drag the GMap from the toolbox onto the page. A new instance of the GMap will appear on the page, with the name ‘GMap1′

7. Add the following lines to your web.config file:

appsettings>
add key="googlemaps.subgurim.net" value="YourGoogleMapsAPIKeyHere" />
/appSettings>

8. Add the following code to your Page.Load sub

Dim sStreetAddress As String
Dim sMapKey As String = ConfigurationManager.AppSettings("googlemaps.subgurim.net")
Dim GeoCode As Subgurim.Controles.GeoCode

sStreetAddress = "100 Russell St. Melbourne. VIC. 3000. Australia"
GeoCode = GMap1.geoCodeRequest(sStreetAddress, sMapKey)
Dim gLatLng As New Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng)

GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal)
Dim oMarker As New Subgurim.Controles.GMarker(gLatLng)
GMap1.addGMarker(oMarker)

Source:http://gathadams.com/

Improving Performance with Connection Pooling

Opening a connection is a database-intensive task. It can be one of the slowest operations that you perform in an ASP.NET page. Furthermore, a database has a limited supply of connections, and each connection requires a certain amount of memory overhead (approximately 40 kilobytes per connection).

If you plan to have hundreds of users hitting your Web site simultaneously, the process of opening a database connection for each user can have a severe impact on the performance of your Web site.

Fortunately, you can safely ignore these bad warnings if you take advantage of connection pooling. When database connections are pooled, a set of connections is kept open so that they can be shared among multiple users. When you request a new connection, an active connection is removed from the pool. When you close the connection, the connection is placed back in the pool.

Connection pooling is enabled for both OleDb and SqlClient connections by default.

To take advantage of connection pooling, you must be careful to do two things in your ASP.NET pages.

First, you must be careful to use the same exact connection string whenever you open a database connection. Only those connections opened with the same connection string can be placed in the same connection pool. For this reason you should place your connection string in the web.config file and retrieve it from this file whenever you need to open a connection

Second, you must also be careful to explicitly close whatever connection you open as quickly as possible. If you do not explicitly close a connection with the Close() method, the connection is never added back to the connection pool.

Source: www.dotnetguts.blogspot.com

Difference between ASP & ASP.NET

ASP stands for Active Server Pages. ASP.NET is the next generation of ASP. After the introduction of ASP.NET, old ASP is called 'Classic ASP'.

Classic ASP uses vb script for server side coding. Vb Script is not supported any more in ASP.NET. Instead, ASP.NET supports more languages including C#, VB.NET, J# etc. VB.NET is very similar to vb script, so it should be easy for old Visual Basic or ASP programmers to switch to VB.NET and ASP.NET

VB Script is a simple scripting language, where as VB.NET or C# are modern, very powerfull, object oriented programming languages. Just for that reason, you will be able to write much more robust and reliable programs in ASP.NET compared to ASP.

In classic ASP, there was no server controls. You have to write all html tags manually. ASP.NET offers a very rich set of controls called Server Controls and Html Controls. It is very easy to drag and drop any controls to a web form. The VS.NET will automatically write the required HTML tags automatically for you.

ASP is interpreted, ASP.NET is compiled


Since ASP uses vb script, there is no compilation. All ASP pages are interpreted when th page is executed.

ASP.NET uses modern .NET languages like C#, VB.NET etc. They can be compiled to efficient Microsoft Intermediate Language (MSIL). When you compile an ASP.NET application, the server side code is compiled to assemblies. These assemblies are loaded at run time which makes the ASP.NET pages perform better than classic ASP.

ADO and ADO.NET


Classic ASP uses a technology called ADO to connect and work with databases. ASP.NET uses the ADO.NET technology (which is the next generation of ADO).

Event driven programming


If you have written Visual Basic programs before, you would love the event driven programming approach. It is so easy to drag and drop a button control and double click on the button to write the event handler for the button click event. When you click on the button at turn time, it will execute whatever code you have written in the event handler.

This type of event driven programming was not available with classic ASP. You cannot drag and drop a button and write a 'on click' event handler with ASP.

With ASP.NET, this is changed. It works pretty much like your Visual Basic program. You can write event handlers for several events like button click event, text changed event etc.

However, there is big difference between the way event handling works in regular Visual basic and ASP.NET. In ASP.NET, a page is loaded in the client browser. And the server may be in another location (may be in another country). When you click on the button in an ASP.NET page, the 'click event' handler has to be executed on the server, not on the client.

How does the server know when you click on a button your browser? This is a tricky thing in ASP.NET. When you write an event handler for a button lick or something like that in ASP.NET, lot of things happens behind the screens. ASP.NET will produce lot of client side javascript code to handle this and embed this javascript in the html page it sends to the browser. When you click on the button in the browser, the client side javascript will get executed. This javascript will generate some information required for the server and and submit the page request to the server. There is enough information embedded in this request so that the server will understand that user has clicked a specific button in the browser and it has to execute some 'specific event handler' code in the server side. So, when the user clicks on a button, the page is submitted automatically to the server with some special information. In the server side, it will process the event handler for the button click event and send back the output page to the browser again. Similary, you can write other event handlers like text changed event for Textboxes etc.

As a user of the web page, you will not even know what happened in the background. All you can see is, when you clicked the button, it executed the button click event handler in the server side and you got the result. However, you may notice a delay because the page has to be submitted to the server to execute the event handler.

NOTE: The event handling we just discussed is server side event handling. In addition to that, you can handle any events in the client side using Javascript. This is supported even in classic ASP. The client side event handling is used for simpel client side validation, displaying messages to the user etc. You cannot do any server side programming in client side java script (like accessing the database etc).

Source: www.dotnetspider.com

Difference between Close() and Dispose() Method

The basic difference between Close() and Dispose() is, when a Close() method is called, any managed resource can be temporarily closed and can be opened once again. It means that, with the same object the resource can be reopened or used. Where as Dispose() method permanently removes any resource ((un)managed) from memory for cleanup and the resource no longer exists for any further processing.

Example showing difference between Close() and Dispose() Method:


using System;
using System.Data;
using System.Data.SqlClient;
public class Test
{
private string connString = "Data Source=COMP3;Initial Catalog=Northwind;User Id=sa;Password=pass";
private SqlConnection connection;
public Test()
{
connection = new SqlConnection(connString);
}
private static void Main()
{
Test t = new Test();
t.ConnectionStatus();
Console.ReadLine();
}
public void ConnectionStatus()
{
try
{
if(connection.State == ConnectionState.Closed)
{
connection.Open();
Console.WriteLine("Connection opened..");
}

if(connection.State == ConnectionState.Open)
{
connection.Close();
Console.WriteLine("Connection closed..");
}
// connection.Dispose();

if(connection.State == ConnectionState.Closed)
{
connection.Open();
Console.WriteLine("Connection again opened..");
}
}
catch(SqlException ex)
{
Console.WriteLine(ex.Message+"\n"+ex.StackTrace);
}
catch(Exception ey)
{
Console.WriteLine(ey.Message+"\n"+ey.StackTrace);
}
finally
{
Console.WriteLine("Connection closed and disposed..");
connection.Dispose();
}
}
}

In the above example if you uncomment the "connection.Dispose()" method and execute, you will get an exception as, "The ConnectionString property has not been initialized.".This is the difference between Close() and Dispose().