Showing posts with label Definitions. Show all posts
Showing posts with label Definitions. Show all posts

Thursday, February 26, 2015

How to Enable Failed-Request Tracing / Not able to find Failed-Request Tracing option in IIS

Sometimes we have to enable Failed request tracing in order to trace the issues in the server. Normally we use Failed Request tracing to know what exactly is happening with the request. Best examples to enable Failed Request tracing is to find out the performance issues, authentication failures, Server 500 error, 404 error etc.

Sometimes when you try to configure the Failed Request Tracing you may not find that option because you may not have installed the IIS components to enable that feature. So first lets see the place where you will find this option.

Lets open IIS first, press Window + R button or Start –>Run and then type inetmgr.
Expand your system name—>Sites—> Click on Default Web Site.

Now look at your right side window “Actions” In Actions pane under Configure section you should get “Failed Request Tracing…. “ option.

Sometimes as I mentioned above you may not see this option. It will be like below screen.

 image
In such cases first we will install the required component.

Go to Control Panel\All Control Panel Items\Programs and Features and then click on Turn Windows features on or off.

Go to Internet Information Service-->World Wide Web Services--> Application Development Features—> Select ASP.NET

Expand Health and Diagnostics—>Select Tracing

Click OK to install this component.

image

Once you install above components open IIS again and go to the Action and under Configure section you can see Failed Request Tracing…

image
To enable Failed Request Tracing Click on the link “Failed Request Tracing…. “ and select the Enable button. You can also change the path in case you wanted to save this log file in a different location than the default location. Also as you can see you will be able to change the Maximum number of trace files as well. This is to avoid your Disk getting full with trace files. Last 50 or 100 file would be sufficient to investigate any issues.
image
I hope now you are clear on how to enable Failed Request tracing and were you can see the Trace log files.

Monday, November 10, 2014

Filtered Index in MS SQL

What is filtered index? What is the benefit of using filtered index? Does filtered index really improves the performance? All these queries will be answered in this article.
Lets start with what is filtered index? A kind of interview question.
Filtered index is an optimized non clustered index. Filtered index is more suitable for the queries which select the data from a well defined subset. Important thing you have to remember about the filtered index is it uses the filter predicate to index only a portion of rows in a table. This is what I have mentioned above that “filtered index is suitable for the queries which select the data from a well defined subset”.
Does the filtered index improve the performance?

Thursday, September 4, 2014

GROUPING SETS in MS SQL

I have been doing some reporting work today. In that report I have to show some trending. In fact I have to show average salary based on the city and department. I was thinking what will be the easiest option to display in that manner, only thing is I don’t want to write huge SQL query to show this data.  Nothing to worry now, you have an option in MS SQL that is nothing by grouping set.
Today we will see how we can use GROUPING SET in SQL query and when exactly we can use this query.
First we will create a table with the name tblStatistics.

Saturday, January 10, 2009

When to Use Delegates Instead of Interfaces (C# )


Both delegates and interfaces allow a class designer to separate type declarations and implementation. A given interface can be inherited and implemented by any class or struct; a delegate can created for a method on any class, as long as the method fits the method signature for the delegate. An interface reference or a delegate can be used by an object with no knowledge of the class that implements the interface or delegate method. Given these similarities, when should a class designer use a delegate and when should they use an interface?
Use a delegate when:
•    An eventing design pattern is used.
•    It is desirable to encapsulate a static method.
•    The caller has no need access other properties, methods, or interfaces on the object implementing the method.
•    Easy composition is desired.
•    A class may need more than one implementation of the method.
Use an interface when:
•    There are a group of related methods that may be called.
•    A class only needs one implementation of the method.
•    The class using the interface will want to cast that interface to other interface or class types.
•    The method being implemented is linked to the type or identity of the class: for example, comparison methods.
One good example of using a single-method interface instead of a delegate is IComparable or IComparable. IComparable declares the CompareTo method, which returns an integer specifying a less than, equal to, or greater than relationship between two objects of the same type. IComparable can be used as the basis of a sort algorithm, and while using a delegate comparison method as the basis of a sort algorithm would be valid, it is not ideal. Because the ability to compare belongs to the class, and the comparison algorithm doesn’t change at run-time, a single-method interface is ideal.

Thursday, January 8, 2009

Advantages of Using Globally Unique Identifier (GUID) as a Primary Key.

Advantages of Using Globally Unique Identifier (GUID) as a Primary Key Advantages:
 
■ If you use an auto-number Id column and if many people are creating new DataRow objects, it will be difficult for you to merge data later because there may be many duplicate keys.

■ The Guid data type is a “surrogate” key, meaning that its only purpose is to define uniqueness of the row and aid in connecting multiple tables together via relationships. This means that there is no reason for a user to see and change this value, which simplifies maintenance of the DataSet. If you allow the user to change the primary key on a row, you have to propogate the change down to all of the related tables. For example, changing the CompanyId value requires the update of the Company Id value in the Employee table.

■ The use of the Guid can simplify the joining of tables, which is better than the scenarios where you use compound keys that are based on the actual data. Compound keys typically result in smaller data footprints because the key is based on actual data, whereas joining tables is usually more difficult because compound joins are required. Remember that if you are using compound keys that are based on the actual data, you inevitably need to deal with recursive updates.

Advantages of JQuery? or Why we Use JQuery?

The first thing that most Javascript programmers end up doing is adding some code to their program, similar to this:
window.onload = function(){ alert("welcome"); }
Inside of which is the code that you want to run right when the page is loaded. Problematically, however, the Javascript code isn't run until all images are finished downloading (this includes banner ads). The reason for using “window.onload” in the first place is due to the fact that the HTML 'document' isn't finished loading yet, when you first try to run your code.
To circumvent both problems, here comes jQuery...Write Less, Do More, JavaScript Library.
   1:  <HTML>
   2:  <head>
   3:   
   4:  <!--download jquery.js and use the same version.
       here i used "jquery-1.2.6.min.js"-->
   5:  <script type="text/javascript" 
       src="jquery-1.2.6.min.js"></script>
   6:   
   7:  <script type="text/javascript">
   8:   
   9:  //Mandatory function to start jquery on load.
  10:  $(document).ready( function() {
  11:   
  12:  //below line will apply style to all paragraph so 
       this should come first. 
  13:  //Try moving this line below the paragraph by id tag
       style and see the difference.
  14:  $("p").css( {color: "yellow", background: "green"} ); 
  15:   
  16:   
  17:  //Firsr and second are the name of the paragraph.
  18:  $("#First").css( {color: "red",
       background: "yellow"} );  
  19:  $("#Second").css( {color: "white",
       background: "black"} );  
  20:   
  21:  //another function to play around the anchor <a> tag
  22:     $("a").click(function(event)
  23:      {
  24:        alert("Welcome to asheej.blogspot.com");
  25:   
  26:  //comment the above single line and uncomment below
       three line and see what JQyery can do.
  27:   
  28:  //      alert("As you can see, the link no longer took
       you to jquery.com");
  29:  //      event.preventDefault();
  30:  //        $(this).hide("slow");
  31:   
  32:       }
  33:       );
  34:   
  35:  });
  36:  </script>
  37:   
  38:  <head/>  
  39:   
  40:  <BODY>  
  41:   
  42:      <DIV style="border: 3px solid Green;">  
  43:      <A href= "http://asheej.blogspot.com/">Google</a>  
  44:      </DIV>  
  45:   
  46:      <P id="First">This is First paragraph</p>  
  47:      <P id="Second">This is Second paragraph</p>  
  48:      <P>This is Third paragraph</p>  
  49:      <P>This is Fourth paragraph</p>  
  50:   
  51:  </BODY>  
  52:  </HTML>  

Sunday, July 6, 2008

Difference between Copying and Cloning the DataTable

Copying and Cloning the DataTable: You often need to create a full copy of a DataTable in your application, possibly to pass it to another application, or to use as a scratch pad for operations that may be thrown out later.

For example, you may want to assign a DataTable object to a GridView control to allow a user to edit the data, but you also may want to provide a cancel button that aborts all changes on the Web page.

A simple way to implement this functionality is to create a copy of your DataTable object and use the copy for editing. If the user clicks the cancel button, the DataTable copy is thrown out.

If the user decides to keep the changes, you can replace the original DataTable object with the edited copy.

To create a copy of a DataTable object, use the Copy method on the DataTable, which copies the DataTable object schema and data.

The following code snippet shows how to invoke the Copy method:
'VB
Dim copy as DataTable = employee.Copy( )
 
//C#
DataTable copy = employee.Copy( );

You often require a copy of the DataTable schema without the data. You can accomplish this by invoking the Clone method on the DataTable. Use this method when an empty copy of the DataTable is required and to which DataRow objects will be added at a later time.

The following code shows the Clone method:

'VB
Dim clone as DataTable = employee.Clone( )
//C#
DataTable clone = employee.Clone( );