Showing posts from 2014

Allow Video format to play in MediaPlayer

This is a common problem with video format type to play in the web site/web applications if we use the media player.
In this article, I would like to give a simple solution to allow the “*.mp4” format video files to play in the media player in our web application in the IIS.

This video file format is not allowed in the IIS under MIME type. The following steps are done in the Internet Information Server (IIS). Step# 1 Start IIS Manager

Select the appropriate website to which we want to allow “mp4” format, then click MIME types

Step# 2
Click on Add

 Step# 3 Enter the video format information File name extension:

Suppress the warning messages in Visual Studio

Sometimes we might have seen the warning message when we build the solution. These warning won't stop your application execution in fact these are most useful to preventing the defects.
In order to suppress this warning message we need to use the pre-processor directives i.e., "#pragma warning".
Example : As shown in the below image , the variable count is assigned and didn't used that value any where. When we build the project able to see a warning in the Error List window.

To overcome this warning we need to define the pragma warning pre-processor directive to the variable as shown below.

#pragma warning disable
  int count = 1;
#pragma warning resotre

Hope this article helped you to supress the warnings in visual studio :-)

Column COLLATION can affect SQL Server query performance ?

I found an interesting article on column collation in SQL Server. Please refer this Column Collation article from SQL Server Tips site.

Exporting to excel from a custom class object using C#.NET

We may face a scenario to export the data of custom class object to excel using InterOp.You can get the property name's from the class object using Reflection.Create a work sheet header by reading the each propety of the class object.I have created a separate method to get the all properties into a list collection of string as given below


        /// Get the list of Properties Name into a list collection.

        public List GetPropeties(Employee objEmployee)
            Type myType = objEmployee.GetType();
            IList props = new List(myType.GetProperties());
            List lstPropertiesNames = new List();

            foreach (PropertyInfo prop in props)
            return lstPropertiesNames;

We need to call this method to create the worksheet header's as given beloe
List lstProperties = GetPropeties(new Employee());
                Char x = …