Wednesday 24 April 2013

How to change life

जिद जिसने बदल दी जिंदगी
Cover story: august 2012
जिद नाम है उस हौसले का जिसमें नामुमकिन को मुमकिन बनाने का जुनून हो। बिरले ही होते हैं ऐसे जिद्दी लोग और उनके मजबूत इरादों के सामने दुनिया घुटने टेकने को मजबूर होती है। लगभग 1200  आविष्कार करने वाले अमेरिकी वैज्ञानिक थॉमस अल्वा एडिसन की प्रतिभा को उनके शिक्षक भी पहचान न सके। दिन-रात कल्पना की दुनिया में खोए रहने वाले एडिसन को वे मंदबुद्धि मानते थे। इसी आधार पर उन्हें स्कूल से निकाल दिया गया था। निर्धन परिवार में जन्मे एडिसन  ट्रेन में अखबार  बेच कर गुजारा करते थे। बिजली के बल्ब का आविष्कार करने के दौरान उनके सौ से भी ज्यादा  प्रयास विफल हुए। लोगों ने उनका बहुत मजाक उडाया और उन्हें भविष्य में ऐसा न करने की सलाह दी। फिर भी उन्होंने हार नहीं मानी। अंतत:  जब बल्ब की रौशनी से दुनिया जगमगा उठी तो लोग हैरत में पड गए। एडिसन को अपनी कोशिशों पर पक्का यकीन था। इसीलिए वह अडिग रहे। आसान नहीं होता अपनी बात पर अडिग रहना, पर जिसके इरादों में सच्चाई हो, उसे दुनिया की कोई भी ताकत झुका नहीं सकती।
हौसले की होती है हमेशा जीत
जब भी दृढ इच्छाशक्ति की बात निकलती है तो दुष्यंत कुमार का यह शेर हमें बरबस याद आ जाता है- कैसे आकाश में सूराख हो नहीं सकता/ एक पत्थर तो तबीयत से उछालो यारों..। साधनों की कमी की शिकायत करते हुए खुद कोई प्रयास न करना तो बेहद आसान है। ज्यादातर लोग करते भी यही हैं, लेकिन कुछ ऐसे भी होते हैं, जिनकी इच्छाशक्ति ही उनकी सबसे बडी पूंजी होती है। बिहार के गया जिले के छोटे से गांव गहलौर  के दलित मजदूर दशरथ मांझी की जिद के आगे पर्वत को भी झुकना पडा। उन्होंने राह रोकने वाले पहाड का सीना चीर कर 365  फीट लंबा और 30  फीट चौडा रास्ता बना दिया। दरअसल पहाडी का रास्ता बहुत संकरा और उबड-खाबड  था। उनकी पत्नी उसी रास्ते से पानी भरने जाती थीं। एक रोज उन्हें ठोकर लग गई और वह गिर पडीं। पत्नी के शरीर पर चोट के निशान देख दशरथ को बहुत गुस्सा आया और उन्होंने उसी दम ठान लिया कि अब वह पहाडी को काटकर ऐसा रास्ता बनाएंगे, जिससे किसी को भी ठोकर न लगे। वह हाथों में छेनी-हथौडा लेकर पहाड काटने में जुट गए। तब लोग उन्हें पागल और सनकी समझते थे कि कोई अकेला आदमी पहाड काट सकता है भला! .पर उन्होंने अपनी जिद के आगे किसी की नहीं सुनी। वह रोजाना सुबह से शाम तक अपने काम में जुटे रहते। उन्होंने 1960  में यह काम शुरू किया था और इसे पूरा करने में उन्हें 22  वर्ष लग गए। ..लेकिन अफसोस कि उनका यह काम पूरा होने से कुछ दिनों पहले ही उनकी पत्नी का निधन हो गया। वह अपनी सफलता की यह खुशी उनके साथ बांट न सके। उनकी इस कोशिश से ही बेहद लंबा घुमावदार पहाडी रास्ता छोटा और सुगम हो गया। अब दशरथ इस दुनिया में नहीं हैं पर वह रास्ता आज भी हमें उनके जिद्दी और जुझारू व्यक्तित्व की याद दिलाता है। उनकी दृढ इच्छाशक्ति को सम्मान देते हुए दिल्ली विश्वविद्यालय ने अपने कर्मचारियों के लिए दशरथ मांझी पुरस्कार की शुरुआत की है।
गुस्सा भी होता है अच्छा
जिद की तरह गुस्सा भी हमारी नकारात्मक भावनाओं में शुमार होता है और इन दोनों का बडा ही करीबी रिश्ता है। इस संबंध में मनोवैज्ञानिक सलाहकार डॉ. अशुम गुप्ता कहती हैं, अगर किसी दुर्भावना की वजह से गुस्सा आए और कोई किसी को नुकसान पहुंचाने की जिद करे तो निश्चित रूप से यह खतरनाक  प्रवृत्ति है। इससे इंसान केवल दूसरों का ही नहीं, बल्कि अपना भी अहित कर रहा होता है। हमारी मानसिक संरचना में ये दोनों भावनाएं बिजली की तरह काम करती हैं। अगर सही जगह पर इनका इस्तेमाल किया जाए तो चारों ओर रौशनी फैल सकती है। अगर इनका गलत इस्तेमाल हो तो पल भर में जल कर सब कुछ खाक  हो सकता है। यहां असली मुद्दा नकारात्मक भावनाओं को सकारात्मक ढंग से चैनलाइज  करने का है। अगर बच्चा अपनी मनपसंद चीज लेने की जिद करता है तो बडों को हमेशा उसकी जिद पूरी नहीं करनी चाहिए, बल्कि उससे यह वादा लेना चाहिए कि तुम परीक्षा में अच्छे मा‌र्क्स  लाओ तो तुम्हारी मांग जरूर पूरी की जाएगी। इससे उसे यह एहसास होगा कि बिना मेहनत के कुछ भी हासिल नहीं होता और उसकी जिद पढाई की ओर रुख कर लेगी।
गुस्से के सकारात्मक इस्तेमाल के संदर्भ में चिपको आंदोलन के अग्रणी नेता सुंदर लाल बहुगुणा द्वारा कही गई एक बात बरबस याद आ जाती है, पेड काटने वाले लोगों को देखकर मुझे बहुत ज्यादा गुस्सा आता है। इसलिए मैंने यह संकल्प लिया है कि इतने पेड लाऊंगा कि काटने वाले भले ही थक जाएं, फिर भी हमारी धरती हमेशा हरी-भरी बनी रहे। सच, लाचारी भरी शांति से तो ऐसा गुस्सा हजार गुना बेहतर है, जिससे देश और समाज का भला हो।
दिल पर लगी तो बात बनी
कई बार हमें दुख पहुंचाने वाले या हमारे साथ बुरा बर्ताव करने वाले लोग अनजाने में ही सही, लेकिन हमारी भलाई कर जाते हैं। इस संबंध में डॉ. अशुम  गुप्ता आगे कहती हैं, कई बार दूसरों द्वारा कही गई कडवी बात हमारे लिए शॉक ट्रीटमेंट का काम करती है। ऐसी बातें सुनकर हमारा सोया हुआ जमीर जाग उठता है। फिर हम कई ऐसे मुश्किल काम भी कर गुजरते हैं, जिनके बारे में आमतौर पर सोचना भी असंभव लगता है। जरा सोचिए कि अगर तुलसीदास को अपनी पत्नी रत्नावली की बात दिल पर न लगी होती तो आज हिंदी साहित्य श्रीरामचरितमानस जैसे महाकाव्य से वंचित रह जाता। अगर दक्षिण अफ्रीका के पीट्मेरीज्बर्ग स्टेशन पर उस टीटी ने बैरिस्टर मोहनदास करमचंद  गांधी का सामान ट्रेन की फ‌र्स्ट क्लास की बोगी से बाहर न फेंका होता तो शायद आज भारत का इतिहास कुछ और ही होता।
जब बात हो अपनों की
जिद के साथ कहीं न कहीं अपनों का प्यार और उनकी भावनाएं भी जुडी होती हैं। दिल्ली की मैरी बरुआ का इकलौता बेटा ऑटिज्म से पीडित था। वह दिन-रात उसकी देखभाल में जुटी रहतीं। वह कहती हैं, मेरे लिए मेरा बेटा ही सब कुछ है। मैंने उसकी खातिर ऐसे बच्चों को ट्रेनिंग देने का स्पेशल कोर्स किया। उसी दौरान मुझे यह खयाल आया कि सिर्फ मेरा ही बेटा क्यों.? ऐसे दूसरे बच्चों को भी ट्रेनिंग देकर मैं उन्हें कम से कम इस लायक तो बना दूं कि ये अपने रोजमर्रा के काम खुद करने में सक्षम हों और बडे होने के बाद सामान्य जिंदगी जी सकें। तभी से मैंने ऑटिज्म  से पीडित दूसरे बच्चों की देखभाल शुरू कर दी। इससे मेरे मन को बहुत सुकून  मिलता है। अब जिंदगी से कोई शिकायत नहीं है, बल्कि ऐसा महसूस होता है कि ईश्वर ने मुझे इस काबिल समझा, तभी तो ऐसे बच्चों की जिम्मेदारी मुझे सौंपी है।
फर्क चश्मे का
अकसर हम लोगों के अडियल व्यवहार को नापसंद करते हैं। आकांक्षा जैन एक निजी कंपनी में मार्केटिंग मैनेजर हैं। इस संबंध में उनका कहना हैं, शुरू से मेरी आदत रही है कि अगर मैंने एक बार कोई काम ठान लिया तो चाहे बीच कितनी ही बाधाएं क्यों न आएं मैं उसे पूरा करके ही दम लेती हूं। मेरी इस आदत की वजह से लोग मुझसे नाराज भी होते हैं, पर बाद में जब वह काम अच्छी तरह पूरा हो जाता है तो उन्हें अपनी गलती का एहसास होता है। अडियल या परफेक्शनिस्ट  होने में कोई बुराई नहीं है। अगर हमारा दृष्टिकोण सकारात्मक हो तो हमें लोगों के जिद्दी व्यवहार का अच्छा पहलू भी नजर आएगा। अगर ऐसा न हो तो दूसरों के हर अच्छे व्यवहार में भी बुराई नजर आएगी।
सामाजिक स्वीकृति में दिक्कत
इस संबंध में समाजशास्त्री डॉ. शैलजा  मेनन  कहती हैं, किसी भी समाज में हमेशा वही व्यवहार स्वीकार्य होता है, जिससे सामने वाले व्यक्ति को कोई असहमति न हो। अगर कोई व्यक्ति लीक से हट कर कुछ भी करना चाहता है तो उसके आसपास के लोग उसे सहजता से स्वीकार नहीं पाते और वे ऐसे व्यक्ति को शक की निगाहों से देखते हैं।
अपनी ही धुन में लगे रहने वाले ऐसे क्रिएटिव  लोगों को शुरुआती दौर में अकसर आलोचना का सामना करना पडता है, लेकिन उन पर नकारात्मकबातों का कोई असर नहीं होता। बाद में दुनिया को उनकी काबिलीयत की पहचान होती है और लोग उन्हें सुपर हीरो बना देते हैं, लेकिन तब तक बहुत देर हो चुकी होती है।
महान इटैलियन वैज्ञानिक गैलीलियो  की जिंदगी इसकी सबसे बडी मिसाल है। उन्होंने उस पारंपरिक धारणा का खंडन किया था कि सूर्य पृथ्वी की परिक्रमा करता है। उन्होंने ही सबसे पहले इस बात की खोज की थी कि पृथ्वी सूर्य के चारों ओर घूमती है। आज उसी वेटिकन सिटी के चर्च में उनकी मूर्ति लगाई जा रही है, जहां 400  साल पहले उनकी इस खोज  को धार्मिक ग्रंथों के खिलाफ  बताते हुए उन्हें यातना शिविर में बंद किया गया था और घोर शारीरिक-मानसिक यातनाएं दी गई थीं। अब सदियों बाद अपने इस प्रयास से चर्च अपनी उस पुरानी गलती का पश्चात्ताप करना चाहता है।
सामाजिक स्वीकृति में दिक्कत
जिद्दी और जोशीले लोगों को चुनौतियां स्वीकारना बहुत अच्छा लगता है। इस संबंध में सॉफ्टवेयर इंजीनियर सिद्धार्थ शर्मा का कहना है, हमारे परिवार की आर्थिक स्थिति अच्छी नहीं थी। हमारे पिता बेहद मामूली सी नौकरी करते थे। हम छह भाई-बहनों की परवरिश बहुत मुश्किल थी। मैं इंजीनियर बनना चाहता था, पर मुझे मालूम था कि इसके लिए पिताजी पैसे नहीं जुटा पाएंगे। इसलिए जी जान से पढाई में जुटा रहता। मैंने ठान लिया था कि मैं केवल मेहनत के बल पर अपना सपना साकार करूंगा। बिना किसी कोचिंग के आईआईटी  के लिए मेरा चयन  हो गया। आगे की पढाई का खर्च  मैंने खुद ट्यूशन करके उठाया। आज इंजीनियर बनने से कहीं ज्यादा, मुझे इस बात की खुशी है कि मैंने संसाधनों की कमी के बावजूद विपरीत परिस्थितियों में भी कामयाबी हासिल की है। अगर कामयाबी ज्यादा  मुश्किलें उठाने के बाद मिले तो उसका मजा दोगुना हो जाता है।

Monday 15 April 2013

Fwd: SSC CGL Exam 2013 Postponed New Exam Dates 2013

Subject: New Exam Dates of SSC CGL Exam 2013


The Combined Graduate Level Examination 2013 scheduled to be held on 14th April 2013 and 21st April 2013. As the Government has declared a closed holiday on account of the Birth Anniversary of Dr. B.R. Ambedkar, the examination scheduled on 14th April 2013 has been postponed. Revised Admission Certificates may be downloaded from the website i.e. sscnr.net.in on or after 21.04.2013.


This Exam will be conducted on 28 April 2013.  But the Exam which was on 21 April 2013, it will not be change. For more details of SSC CGL Exam 2013, you can visit our web portal which is recruitmentresult.com.  Following details are mention below for CGL Exam 2013:


Important date
Postponed new Exam Date: 14 April 2013 replace 28 April 2013
Same Exam Date: 21 April 2013 (No change)
Note: You may visit following official Link:
Important Links:



Wednesday 2 November 2011

Windows XP Shortcut Keys

Windows 7 shortcut keys

Many assistive software programmes make use of the short cut keys in Windows. Their use is often quicker than having to move to the mouse and back to perform a specific action.

Accessibility keyboard shortcuts

Fliter keys sets up the keyboard to ignore repeated or momentary key presses
Right SHIFT for eight seconds Switch Filter Keys on and off.
High contrast screen mode can be turned on or off via the following combination :-
Left ALT +left SHIFT +PRINT SCREEN Switch High Contrast on and off. ( works before the login)
Further changes can be made with the accessibility wizard in the accessibility programme group
Left ALT +left SHIFT +NUM LOCK Switch Mouse Keys on and off.
Mouse keys can emulate mouse movements on the keyboard
SHIFT five times Switch Sticky Keys on and off.
Sticky keys will allow successive key presses to be recorded as simultaneous ones eg to help the CNTRL + ALT + DELETE option for logging in.
NUM LOCK for five seconds Switch Toggle Keys on and off.
Toggle keys gives an audible warning when the CAPS LOCK, NUM LOCK and SCROLL LOCK

General keyboard shortcuts


CTRL+C Copy.
CTRL+X Cut.
CTRL+V Paste.
CTRL+Z
Undo.
CTRL+RIGHT ARROW Move the insertion point to the beginning of the next word.
CTRL+LEFT ARROW Move the insertion point to the beginning of the previous word.
CTRL+DOWN ARROW Move the insertion point to the beginning of the next paragraph.
CTRL+UP ARROW Move the insertion point to the beginning of the previous paragraph.
CTRL+SHIFT with any of the arrow keys Highlight a block of text.
SHIFT with any of the arrow keys Select more than one item in a window or on the desktop, or select text within a document.
CTRL+A Select all.
F3 Search for a file or folder.
ALT+ENTER View properties for the selected item.
ALT+F4 Close the active item, or quit the active program.
ALT+ENTER Displays the properties of the selected object.
ALT+SPACEBAR Opens the shortcut menu for the active window.
CTRL+F4 Close the active document in programs that allow you to have multiple documents open simultaneously.
ALT+TAB Switch between open items.
ALT+ESC Cycle through items in the order they were opened.
F6 Cycle through screen elements in a window or on the desktop.
F4 Display the Address bar list in My Computer or Windows Explorer.
SHIFT+F10 Display the shortcut menu for the selected item.
ALT+SPACEBAR Display the System menu for the active window.
CTRL+ESC Display the Start menu.
ALT+Underlined letter in a menu name Display the corresponding menu.
Underlined letter in a command name on an open menu Carry out the corresponding command.
F10 Activate the menu bar in the active program.
RIGHT ARROW Open the next menu to the right, or open a submenu.
LEFT ARROW Open the next menu to the left, or close a submenu.
F5 Refresh the active window.
BACKSPACE View the folder one level up in My Computer or Windows Explorer.
ESC Cancel the current task.
SHIFT when you insert a CD into the CD-ROM drive Prevent the CD from automatically playing.


Dialog box keyboard shortcuts


CTRL+TAB Move forward through tabs.
CTRL+SHIFT+TAB Move backward through tabs.
TAB Move forward through options.
SHIFT+TAB Move backward through options.
ALT+Underlined letter Carry out the corresponding command or select the corresponding option.
ENTER Carry out the command for the active option or button.
SPACEBAR Select or clear the check box if the active option is a check box.
Arrow keys Select a button if the active option is a group of option buttons.
F1 Display Help.
F4 Display the items in the active list.
BACKSPACE Open a folder one level up if a folder is selected in the Save As or Open dialog box.


Windows Explorer keyboard shortcuts


END Display the bottom of the active window.
HOME Display the top of the active window.
NUM LOCK+ASTERISK on numeric keypad (*) Display all sub folders under the selected folder.
NUM LOCK+PLUS SIGN on numeric keypad (+) Display the contents of the selected folder.
NUM LOCK+MINUS SIGN on numeric keypad (-) Collapse the selected folder.
LEFT ARROW Collapse current selection if it's expanded, or select parent folder.
RIGHT ARROW Display current selection if it's collapsed, or select first sub folder

Primary and Foreign Keys in SQL Database


Primary and Foreign Keys

Database Primary and Foreign Keys:
Primary and foreign keys are the most basic components on which relational database theory is based. Primary keys enforce entity integrity by uniquely identifying entity instances. Foreign keys enforce referential integrity by completing an association between two entities. The next step in building the basic data model to:
1.    Identify and define the primary key attributes for each entity
2.    Validate primary keys and relationships
3.    Migrate the primary keys to establish foreign keys

Attributes are data items that describe an entity. An attribute instance is a single value of an attribute for an instance of an entity. For example, Name and hire date are attributes of the entity EMPLOYEE. "Robert Thompson" and "12 April 1999" are instances of the attributes name and hire date.
The primary key is an attribute or a set of attributes that uniquely identify a specific instance of an entity. Every entity in the data model must have a primary key whose values uniquely identify instances of the entity.
To qualify as a primary key for an entity, an attribute must have the following properties:
§  It must have a non-null value for each instance of the entity
§  The value must be unique for each instance of an entity
§  The values must not change or become null during the life of each entity instance
In some instances, an entity will have more than one attribute that can serve as a primary key. Any key or minimum set of keys that could be a primary key is called a candidate key. Once candidate keys are identified, choose one, and only one, primary key for each entity. Choose the identifier most commonly used by the user as long as it conforms to the properties listed above. Candidate keys which are not chosen as the primary key are known as alternate keys.
An example of an entity that could have several possible primary keys is Employee. Let's assume that for each employee in an organization there are three candidate keys: Employee ID, Social Security Number, and Name.
Name is the least desirable candidate. While it might work for a small department where it would be unlikely that two people would have exactly the same name, it would not work for a large organization that had hundreds or thousands of employees. However, there is the possibility that an employee's name could change because of marriage (your primary key should never be changed). Employee ID would be a good candidate as long as each employee were assigned a unique identifier at the time of hire. Social Security would work best since every employee is required to have one before being hired.
Composite Keys:
Sometimes it requires more than one attribute to uniquely identify an entity. A primary key that made up of more than one attribute is known as a composite key. Below shows an example of a composite key. Each instance of the entity Work can be uniquely identified only by a composite key composed of Employee ID and Project ID.
Example of Composite Keys
EmployeeID
ProjectID
HoursWorked
01
01
100
01
02
120
02
01
75
02
03
115
03
03
140
03
04
80
Artificial Keys:
An artificial key is one that has no meaning to the business or organization. Artificial keys are permitted when:
1.    no attribute has all the primary key properties, or
2.    the primary key is large and complex
Primary Key Migration:
Dependent entities, entities that depend on the existence of another entity for their identification, inherit the entire primary key from the parent entity. Every entity within a generalization hierarchy inherits the primary key of the root generic entity.
Define Key Attributes:
Once the keys have been identified for the model, it is time to name and define the attributes that have been used as keys.
There is no standard method for representing primary keys in ER diagrams. For this article, the name of the primary key followed by the notation (PK) is written inside the entity box. An example is shown in below:
Entities with Key Attributes
Validate Keys and Relationships
Basic rules governing the identification and migration of primary keys are:
§  Every entity in the data model shall have a primary key whose values uniquely identify entity instances.
§  The primary key attribute cannot be optional (i.e., have null values).
§  The primary key cannot have repeating values. That is, the attribute may not have more than one value at a time for a given entity instance is prohibited. This is known as the No Repeat Rule.
§  Entities with compound primary keys cannot be split into multiple entities with simpler primary keys. This is called the Smallest Key Rule.
§  Two entities may not have identical primary keys with the exception of entities within generalization hierarchies.
§  The entire primary key must migrate from parent entities to child entities and from super type, generic entities, to subtypes, category entities.
Foreign Keys:
A foreign key is an attribute that completes a relationship by identifying the parent entity. Foreign keys provide a method for maintaining integrity in the data (called referential integrity) and for navigating between different instances of an entity. Every relationship in the model must be supported by a foreign key.
Identifying Foreign Keys:
Every dependent and category (subtype) entity in the model must have a foreign key for each relationship in which it participates. Foreign keys are formed in dependent and subtype entities by migrating the entire primary key from the parent or generic entity. If the primary key is composite, it may not be split.
Foreign Key Ownership:
Foreign key attributes are not considered to be owned by the entities to which they migrate, because they are reflections of attributes in the parent entities. Thus, each attribute in an entity is either owned by that entity or belongs to a foreign key in that entity.
If the primary key of a child entity contains all the attributes in a foreign key, the child entity is said to be "identifier dependent" on the parent entity, and the relationship is called an "identifying relationship." If any attributes in a foreign key do not belong to the child's primary key, the child is not identifier dependent on the parent, and the relationship is called "non identifying."

Caching in Asp .Net



Caching In ASP.NET 

One of the performance issues of a database drive Web application is retrieving data from a database. If it needs to access the database with every page request, then the response will be very slow. We can avoid this situation with cache technique. You can cache the data in memory when the page is requested for the first time, and hence forth for the subsequent request the page can be served from cache. This reduces network trips to the backend, minimize server workload and database load too, hence the performance increase.

Even though, ASP.NET 1.0 offered variety of caching, if the cache content of a table in memory is changed in the database after the first request, will that change get reflect in your page when it is served from the cache? No, your application will display old data only. Unfortunately we don’t have a sufficient solution for this problem prior to the release of ASP.NET 2.0. The newer version is having a new feature called “SQL Cache Invalidation”, an opt solution for this problem. Further the new framework extends the existing caching techniques more powerful and easier to use and manage.

In this article we are going to see the new and improved caching techniques available in APS.NET2.0. First, let us see about Data Caching enhancements.

Data Caching
Data Caching allows you to cache random objects, so that your applications need not to recreate them from the server. A new class System.Web.Caching.CacheDependency available in ASP.NET 2.0 enables you to write your own implementation of cache dependency. Further you can cache the data using the new DataSource controls available in ASP.NET 2.0, the following code describes how to enable a cache with a SqlDataSource control.
 
<asp:SqlDataSource
ID="SqlDataSource1"
EnableCaching="true"
CacheDuration="600"
ConnectionString="Server=localhost;database=Pubs"
SelectCommand="SELECT Title FROM Authors"
Runat="server" />
SQL Cache Invalidation
As we have seen earlier, your application may give old data when it is served from cache, without the awareness about the data change made in the database. In ASP.NET 1.X we used to give minimum value for Cache Duration. But this will increase the network load. If we give maximum value for Cache Duration then we will get wrong data. Instead of this if there a notification system, which will notify when ever the data is getting changed in the database, will it solve this problem…? Yes, that is SQL Cache Invalidation. It allows you to update your cached content automatically whenever the data changes in the database.

We can split this feature into two cases, based on the SQL Server version you are having. The new version of SQL Server series ‘Yukon’ codename for SQL Server 2005 can be configured to notify your web application whenever changes have been made to database or a database table or a database row. But in SQL Server 7/ SQL Server 2000, there is no built in notification model. Hence, ASP.NET application has to constantly monitor the database to check for changes. The following figures describe these two cases.

In either case, if there is some change, then items added to the cache that depend on the database are removed from the cache. That is, those items are invalidated.

How to enable SQL Cache Invalidation
You have to do some setup process before start using SQL Cache Invalidation. Two steps involved in this setup process.
1.    Configure SQL Server to support SQL Cache Invalidation
2. Add configuration information into your application’s web.config file
1. Configuring SQL Server
To configure your SQL Server you have to use the command line utility which is, available in your \WINDOWS\Microsoft.NET\Framework\v2.x.xxxxx. Execute the tool with the following options from command prompt.
aspnet_regsql –E –d Pubs –ed

The above line will enable the pubs database for SQL Cache Invalidation.
The following line will enable the Authors table for the same.

Aspnet_regsql –E –d Pubs –t Authors –et

What is happening behind the scenes…?
When you run the first command it will add a new database table called ‘AspNet_SqlCacheTablesForChangeNotification’. This table will have a list of all tables, which are enabled for SQL Cache Invalidation.



When you run the second command, a new trigger will be added to your database and it’ll fires whenever there is a modification in the table you mentioned, in our case ‘Authors’, and it updates the new table created in the previous step.

2. Configuring your web.config file
Include the following lines of code under <system.web> tag in your web.config file.
 
<caching>
<sqlCacheDependency enabled ="true" pollTime="60000">
<databases>
<add name="pubs" connectionStringName="AppConnectionString1" />
</databases>
</sqlCacheDependency>
</caching>
In the above code PollTime value is in milliseconds. In our case 60000 milliseconds means once a minute, application will check the cache table for changes.

The following example code will displays the contents of Titles table in the Pubs database with the advantage of SQL Cache dependency on the sqldatasource control. The page will monitor the table for changes. As along as there is no changes, the page will be served from the cache, once the data get changed the response is invalidated and the data source control reloads the data.
 
<asp:SqlDataSource ID="SqlDataSource1" Runat="server" CacheDuration="500" SqlCacheDependency="PubsDB: Titles" ProviderName="<%$ ConnectionStrings:AppConnectionString1.ProviderName %>"> </asp:SqlDataSource>
If you want to do the same SqlCacheDependency with <%@ OutputCache %> then you have to change your code as shown below.
 
<%@ OutputCache Duration="3600" VaryByParam="none" sqlDependency="pubs:Titles"%>
<asp:SqlDataSource ID="SqlDataSource1" Runat="server" ProviderName="<%$ ConnectionStrings:AppConnectionString1.ProviderName %>"> </asp:SqlDataSource>
Output Caching

Output Caching allows you to cache dynamic page and user control responses on any Http 1.1 cache-capable device in the output stream. Now we are going to see about some of the new enhancements in this technique.

Post Cache Substitution

Let us consider the following scenario, one of your application page is having a small dynamic region as time. In this case you can’t cache the entire page, since you need to update your page time with current time. So you are forced to use a separate usercontrol with the help of fragment caching. Instead of this ASP.NET 2.0 introduced a new feature called post cache substitution (a new API Response.Write Substitution), using this you can insert the dynamic contents, time in you case, into the particular page in every request.

Disk Output Cache

All your cached contents are stored in memory, if it is removed from the output cache due to memory constraint what can you do….? Here comes the new feature, you can save cached response to disk also, in addition to storing them in memory. So, incase of memory constraint, it happened to remove the cached content from memory, still you are having in them in disk. The cool thing is, it persist across application restarts, so that when the application comes back, the page can be served from your disk cache. You have to include
DiskCacheable="true" %> in <%@ OutputCache %> Directive
to turn on this feature for your page.

Cache Profiles

A page can be cached and served based on the cache profile settings in your configuration file. This allows you to manage no. of pages centrally. Still, you can override the cache profile settings with the page cache settings using output cache directive. The following code snippet shows the cache profile setting in the configuration file and corresponding usage of that profile in the page output directive.
Configuration file setting…
<caching >
<outputCacheSettings>
<outputCacheProfiles>
<add name="For1Minute" duration="60" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
Page setting…

<%@ OutputCache CacheProfile="CacheFor60Seconds" VaryByParam="Id" %>
Fragment Caching
In ASP.NET 1.0 you can specify the cache setting for fragment cache during design time only. But in ASP.NET 2.0 the fragment caching ControlCachePolicy API allows you to control caching settings for fragment caching of user control, programmatically.

Conclusion

Already you have tasted the benefits of caching, with ASP.NET 1.x. Now, the new DataSource controls allows you to cache the data, without writing code, SQL Cache Invalidation allows you to keep always updated cache content, seamless to the user, post cache substitution allows you to insert the dynamic content into a cached page. Totally the newer version of ASP.NET brings some more new enhancements in caching, which makes caching easy and more effective.


Thursday 20 October 2011

Why Database Use


Any organization, be it a bank, Manufacturing company, Hospital, university, Conglomerate of a Governments departments , requires huge amount of data in some form or other. All such organization need reo collect data manipulate them and store them for future use. All such types of organization require data for a number of purposes, say;
A)  Preparing sales reports
B)  Forecasting sales
C)  Preparing accounts reports
D)  Getting medical histories of patients

Thus, we can say that data are very vital corporate resources. The amount of data used these data in organizations can be measured in the range of some billions of bytes or characters. The financial investment involved is also very high, Many organizations have become cortically dependent on the continued and successful operations of databases.

What is Database Management System ?


A database management system is an organized collection of facts. In other words we can say that it is a collection of information arranged and presented to serve an assigned purpose.
An example of a database is dictionary, where words are arranged alphabetically. Another example is a telephone directory, where subscriber’s names are listed in alphabetically order. Similarly, when you think of a box of cards with name and addresses written as a mailing list, then the box and its contents form a mailing database. Figure contains cards with mailing addresses. All these cards are placed in alphabetically order of names and the collection of these cards would be called a database.
Note: - Thus information stored in a database is arranged in a particular order.
In order to keep database updated, we may need to perform operation like adding information, removing information, editing existing information, etc. Take the case of a telephone diary, in which you note down the names, address and phone numbers of your friends. This is also a type of database. If you make new friends, you note the information about him /her in the diary which is equivalent to adding data to a database. If address of your friends changes then you note the new address in your diary which means editing a database. If you want to send a letter to your friend then you look into the diary to locate the address. This is called searching a database.
In case your telephone diary captains very large numbers of names, address, phone numbers, moreover, the name are not arranged in any orders. Thus , it would be very difficult to locate the names , address, and phone numbers of your friends .thus It is essential to arrange the names in some order, say alphabetically ,to make search easy, However as the number of friends gets larger, managing the database manually become difficult . A database management software package is a helpful tool in such a situation.