Hello All, We are going to start new batch from next week. message/call or mail us for more details.

4 June 2015

JQuery Interview Questions and Answers for Freshers and Experienced

What is jQuery?
jQuery is not a programming language but a well written JavaScript code. It is a JavaScript code, which do document traversing, event handling, Ajax interactions and Animations.
Why jQuery is needed?
jQuery is needed for the following list:
  • Used to develop browser compatible web applications
  • Improve the performance of an application
  • Very fast and extensible
  • UI related functions are written in minimal lines of codes
Whether jQuery HTML work for both HTML and XML documents?
No, jQuery HTML only works for HTML documents not for XML Documents.
What are the methods used to provide effects?
Some of the effects methods are:
  • Show()
  • Hide()
  • Toggle()
  • FadeIn() and
  • FadeOut()
What is the advantage of using minimized version of jQuery?
Efficiency of web page increases when minimized version of jQuery is used.min.js file will be more than 50% less than the normal js file. Reduction in the file size makes the web page faster.
Is jQuery is a JavaScript or JSON library file?
jQuery is a library of JavaScript file and it consists of DOM, event effects and the Ajax functions. jQuery is said to be a single JavaScript file.
Which operating system is more compatible with jQuery?
Mac, Windows and Linux are more compatible with the jQuery.
How can we include jQuery library in ASP.Net project?
Download the jQuery library from jQuery.com and include that reference in the asp.net page.
Which command will give a version of jQuery?
The command $.ui.version returns jQuery UI version.
In what scenarios jQuery can be used?
jQuery can be used in following scenarios:
  • Apply CSS static or dynamic
  • Calling functions on events
  • Manipulation purpose
  • Mainly for Animation effects
What is the difference between find and children methods?
Find method is used to find all levels down the DOM tree but children find single level down the DOM tree.
What is jQuery connect?
A ‘ jQuery connect’  is a plugin used to connect or bind a function with another  function. Connect is used to execute function from any other function or plugin is executed.
How to use connect?
Connect can be used by downloading jQuery connect file from jQuery.com and then include that file in the HTML file. Use $.connect function to connect a function to another function.
What are the features of jQuery, has been used in web applications?
jQuery uses features like Sliding, File uploading and accordian in web applications.
What are the browser related issues for jQuery?
Browser compatibility of jQuery plugin is an issue and needs lot of time to fix it.
Whether we need to add jQuery file in both Master and Content page?
jQuery file should be added to the Master page and can use access from the content page directly without having any reference to it.
What are the basic selectors in jQuery?
Following are the basic selectors in jQuery:
  • Element ID
  • CSS Name
  • Tag Name
  • DOM hierarchy
Can we call C# code behind using jQuery?
Yes, we can call C# code from jQuery as it supports .net application.
What is the use jQuery.data method?
jQuery.data methods is used to associate the data with the DOM nodes and the objects. This data method makes the jQuery code clear and concise.
What is the use of each function in jQuery?
Each function is used to iterate each and every element of an object. It is used to loop DOM elements, arrays and the object properties.
What is the difference between size and length of jQuery?
Size and length both returns the number of element in an object. But length is faster than the size because length is a property and size is a method.
Can we add more than one ‘document.ready’ function in a page?
Yes, we can add more than one document.ready function in a page. But, body.onload can be added once in a page.
What is the use of jQuery load method?
jQuery load method is a powerful AJAX method which is used to load the data from a server and assign the data into the element without loading the page.
Whether our own specific characters are used in place of $ in jQuery?
Yes, We can use our own variable in place of $ by suing the method called no Conflict () method.
var sample = $.noConflict()
What are the four parameters used for jQuery Ajax method?
The four parameters are
  • URL – Need to specify the URL to send the request
  • type – Specifies type of request(Get or Post)
  • data – Specifies data to be sent to server
  • Cache – Whether the browser should cache the requested page
What is the use of jQuery filter?
The jQuery filter is used to filter the certain values from the object list based on the criteria. Example is to filter certain products from the master list of products in a cart website.
Which program is useful for testing jQuery?
QUnit is used to test jQuery and it is very easy and efficient.
What is CDN?
CDN is abbreviated as Content Distribution network and it is said to be a group of companies in different location with network containing copies of data files to maximize bandwidth in accessing the data.
What are the two types of CDNs?
There are two types of CDNs:
  • Microsoft – Load jQuery from Ajax CDN
  • Google – Load jQuery from Google libraries API
Which sign is used as a shortcut for jQuery?
Dollar ($) sign is used as a shortcut for jQuery.
Is jQuery is a client or server scripting?
jQuery is a client scripting.
What is the script build up by jQuery?
jQuery is a Javascript file and it is single javascript file that contains common DOM, event effects and Ajax functions.
How can we debug jQuery?
There are two ways to debug jQuery:
Debugger keyword
  • Add the debugger to the line from where we have to start debugging and then run Visual Studio in Debug mode with F5 function key.
  • Insert a break point after attaching the process
What are all the ways to include jQuery in a page?
Following are the ways to include jQuery in a page:
  • Local copy inside script tag
  • Remote copy of jQuery.com
  • Remote copy of Ajax API
  • Local copy of script manager control
  • Embedded script using client script object
What is the use of jQuery.ajax method ()?
jQuery.ajax method is used for asynchronous HTTP requests.
Where can we download JQuery?
jQuery javascript can be downloaded from jQuery official website – www.jquery.com
Is jQuery is a replacement of JavaScript?
No, jQuery is not a replacement of JavaScript.
What is called chaining?
Chaining is used to connect multiple events and functions in a selector.
What are the advantages of jQuery?
Following are the advantages of jQuery:
  • Just a JavaScript enhancement
  • Coding is simple, clear, reusable
  • Removal of writing more complex conditions and loops
Whether C# code behind can be called from jQuery?
Yes, we can call C# code behind from jQuery.
What is the use of jQuery.data() method?
jQuery data method is used to associate data with DOM nodes and JavaScript objects. This method will make a code very concise and neat.
What is the difference between onload() and document.ready()?
In a page, we can have only one onload function but we can have more than one document.ready function. Document.ready function is called when DOM is loaded but onload function is called when DOM and images are loaded on the page.
What is the use of jQuery each function?
jQuery each function is used to loop through each and every element of the target jQuery object. It is also useful for multi element DOM, looping arrays and object properties.
How method can be called inside code behind using jQuery?
$.ajax can be called and by declaring WebMethod inside code behind using jQuery.
Which is the fastest selector in jQuery?
ID and Element are the fastest selectors in jQuery.
What is the slowest selector in jQuery?
Class selectors are the slowest selectors in jQuery.
Where jQuery code is getting executed?
jQuery code is getting executed on a client browser.
What is the method used to define the specific character in place of $ sign?
‘NoConflict’ method is used to reference a jQuery and save it in a variable. That variable can be used instead of Sign.
Why jQuery is better than JavaScript?
jQuery is a library used for developing Ajax application and it helps to write the code clean and concise. It also handles events, animation and Ajax support applications.
What are the types of selectors in jQuery?
There are three types of selectors in jQuery:
  • CSS Selector
  • XPath Selector
  • Custom Selector

4 May 2015

SQL Server Shortcut Keys Enlisted

Bookmarks: Clear all bookmarks.
CTRL-SHIFT-F2
Bookmarks: Insert or remove a bookmark (toggle).
CTRL+F2
Bookmarks: Move to next bookmark.
F2
Bookmarks: Move to previous bookmark.
SHIFT+F2
Cancel a query.
ALT+BREAK
Connections: Connect.
CTRL+O
Connections: Disconnect.
CTRL+F4
Connections: Disconnect and close child window.
CTRL+F4
Database object information.
ALT+F1
Editing: Clear the active Editor pane.
CTRL+SHIFT+ DEL
Editing: Comment out code.
CTRL+SHIFT+C
Editing: Copy. You can also use CTRL+INSERT.
CTRL+C
Editing: Cut. You can also use SHIFT+DEL.
CTRL+X
Editing: Decrease indent.
SHIFT+TAB
Editing: Delete through the end of a line in the Editor pane.
CTRL+DEL
Editing: Find.
CTRL+F
Editing: Go to a line number.
CTRL+G
Editing: Increase indent.
TAB
Editing: Make selection lowercase.
CTRL+SHIFT+L
Editing: Make selection uppercase.
CTRL+SHIFT+U
Editing: Paste. You can also use SHIFT+INSERT.
CTRL+V
Editing: Remove comments.
CTRL+SHIFT+R
Editing: Repeat last search or find next.
F3
Editing: Replace.
CTRL+H
Editing: Select all.
CTRL+A
Editing: Undo.
CTRL+Z
Execute a query. You can also use CTRL+E (for backward compatibility).
F5
Help for SQL Query Analyzer.
F1
Help for the selected Transact-SQL statement.
SHIFT+F1
Navigation: Switch between query and result panes.
F6
Navigation: Switch panes.
Shift+F6
Navigation: Window Selector.
CTRL+W
New Query window.
CTRL+N
Object Browser (show/hide).
F8
Object Search.
F4
Parse the query and check syntax.
CTRL+F5
Print.
CTRL+P
Results: Display results in grid format.
CTRL+D
Results: Display results in text format.
CTRL+T
Results: Move the splitter.
CTRL+B
Results: Save results to file.
CTRL+SHIFT+F
Results: Show Results pane (toggle).
CTRL+R
Save.
CTRL+S
Templates: Insert a template.
CTRL+SHIFT+INSERT
Templates: Replace template parameters.
CTRL+SHIFT+M
Tuning: Display estimated execution plan.
CTRL+L
Tuning: Display execution plan (toggle ON/OFF).
CTRL+K
Tuning: Index Tuning Wizard.
CTRL+I
Tuning: Show client statistics
CTRL+SHIFT+S
Tuning: Show server trace.
CTRL+SHIFT+T
Use database.
CTRL+U

2 April 2015

SQL Server:: Log Shipping and Replication

Log shipping involves two copies of a single database that typically reside on different computers. At any given time, only one copy of the database is currently available to clients. This copy is known as the primary database. Updates made by clients to the primary database are propagated by means of log shipping to the other copy of the database, known as the secondary database. Log shipping involves applying the transaction log from every insertion, update, or deletion made on the primary database onto the secondary database.
Log shipping can be used in conjunction with replication, with the following behavior:
  • Replication does not continue after a log shipping failover. If a failover occurs, replication agents do not connect to the secondary, so transactions are not replicated to Subscribers. If a failback to the primary occurs, replication resumes. All transactions that log shipping copies from the secondary back to the primary are replicated to Subscribers.
  • If the primary is permanently lost, the secondary can be renamed so that replication can continue. The remainder of this topic describes the requirements and procedures for handling this case. The example given is the publication database, which is the most common database to log ship, but a similar process can also be applied to subscription and distribution databases.
Note:- We recommend using database mirroring, rather than log shipping, to provide availability for the publication database.


Requirements and Procedures for Replicating from the Secondary If the Primary Is Lost


Be aware of the following requirements and considerations:
  • If a primary contains more than one publication database, log ship all of the publication databases to the same secondary.
  • The installation path for the secondary server instance must be the same as the primary. User database locations on the secondary server must be the same as on the primary.
  • Back up the service master key at the primary. This key will be restored at the secondary. For more information.
  • Log shipping does not guarantee against data loss. A failure on the primary database can result in the loss of data that has not yet been backed up or for backups that are lost during the failure.

Log Shipping with Transactional Replication

For transactional replication, the behavior of log shipping depends on the sync with backup option. This option can be set on the publication database and distribution database; in log shipping for the Publisher, only the setting on the publication database is relevant.
Setting this option on the publication database ensures that transactions are not delivered to the distribution database until they are backed up at the publication database. The last publication database backup can then be restored at the secondary server without any possibility of the distribution database having transactions that the restored publication database does not have. This option guarantees that if the Publisher fails over to a secondary server, consistency is maintained between the Publisher, Distributor, and Subscribers. Latency and throughput are affected because transactions cannot be delivered to the distribution database until they have been backed up at the Publisher; if your application can tolerate this latency, we recommend that you set this option on the publication database. If the sync with backup option is not set, Subscribers might receive changes that are no longer included in the recovered database at the secondary server. 
To configure transactional replication and log shipping with the sync with backup option
  1. If the sync with backup option is not set on the publication database, execute sp_replicationdboption '<publicationdatabasename>', 'sync with backup', 'true'. For more information.
  2. Configure log shipping for the publication database.
  3. If the Publisher fails, restore the last log of the database to the secondary server, using the KEEP_REPLICATION option of RESTORE LOG. This retains all replication settings for the database. For more information.
  4. Restore the msdb database and master databases from the primary to the secondary. For more information, If the primary was also a Distributor, restore the distribution database from the primary to the secondary.
    These databases must be consistent with the publication database at the primary in terms of replication configuration and settings.
  5. At the secondary server, rename the computer and then rename the SQL Server instance to match the primary server name. For information about renaming the computer, see the Windows documentation. For information about renaming the server.
  6. At the secondary server, restore the service master key that was backed up from the primary. 
To configure transactional replication and log shipping without the sync with backup option
  1. Configure log shipping for the publication database. For more information.
  2. If the Publisher fails, restore the last log of the database to the secondary server, using the KEEP_REPLICATION option of RESTORE LOG. This retains all replication settings for the database. 
  3. Restore the msdb database and master databases from the primary to the secondary. If the primary was also a Distributor, restore the distribution database from the primary to the secondary.
    These databases must be consistent with the publication database at the primary in terms of replication configuration and settings.
  4. At the secondary server, rename the computer and then rename the SQL Server instance to match the primary server name. For information about renaming the computer, see the Windows documentation. For information about renaming the server.
    You might receive an error message from the Log Reader Agent that the publication database and the distribution database are not synchronized.
  5. At the secondary server, restore the service master key that was backed up from the primary. 
  6. Execute sp_replrestart. This stored procedure can be used to force the Log Reader Agent to ignore all the previous replicated transactions in the publication database log. Transactions applied after the completion of the stored procedure are processed by the Log Reader Agent. 
  7. Restart the Log Reader Agent after the stored procedure executes successfully. 
  8. Transactions that have already been distributed to Subscriber might be applied at the Publisher. To ensure that the Distribution Agent does not fail with an error when attempting to reapply these transactions at a Subscriber, specify the agent profile titled Continue On Data Consistency Errors.

Log Shipping with Merge Replication

Follow the steps in the procedure below to configure merge replication and log shipping.
To configure merge replication and log shipping
  1. Configure log shipping for the publication database. For more information.
  2. If the Publisher fails, at the secondary server, rename the computer and then rename the SQL Server instance to match the primary server name. For information about renaming the computer, see the Windows documentation. For information about renaming the server.
  3. Restore the last log of the database to the secondary server, using the KEEP_REPLICATION option of RESTORE LOG. This retains all replication settings for the database. 
  4. Restore the msdb database and master databases from the primary to the secondary.  If the primary was also a Distributor, restore the distribution database from the primary to the secondary.
    These databases must be consistent with the publication database at the primary in terms of replication configuration and settings.
  5. At the secondary server, restore the service master key that was backed up from the primary. For more information.
  6. Synchronize the publication database with one or more subscription databases. This allows you to upload those changes made previously in the publication database, but not represented in the restored backup. The data that can be uploaded depends on the way in which a publication is filtered:
    • If the publication is not filtered, you should be able to bring the publication database up-to-date by synchronizing with the most up-to-date Subscriber.
    • If the publication is filtered, you might not be able to bring the publication database up-to-date. Consider a table that is partitioned such that each subscription receives customer data only for a single region: North, East, South, and West. If there is at least one Subscriber for each partition of data, synchronizing with a Subscriber for each partition should bring the publication database up-to-date. However, if data in the West partition, for example, was not replicated to any Subscribers, this data at the Publisher cannot be brought up-to-date. In this case, we recommend reinitializing all subscriptions so that the data at the Publisher and Subscribers converges. For more information.
    If you synchronize with a Subscriber that is running a version of SQL Server prior to SQL Server 2005, the subscription cannot be anonymous; it must be a client subscription or server subscription (referred to as local subscriptions and global subscriptions in previous releases). For more information.