Today we faced a weird issue. We noticed that on one machine images were not displaying in browser. On taking screenshot of same window the images appeared in the screenshot. After checking the Firebu...
While using Directory.GetFiles I started getting the following excpetion Path too long error message when exceeding MAX_PATH Luckily I came across the following library: Delimon.Win32.IO Library (V4....
While using the File.Move method to move a file from one location to other: File.Move(oldPath, newPath); I was getting the following exception: Access to the path is denied. Exception Details: System....
When IIS sends the response to browser it also sends "X-Powered-By" HTTP Headers along with the response. It can pose security risk to your server. It can be removed via adding following cod...
Whenever a browser makes an HTTP request to a web server, the webserver sends the response along several HTTP headers. SOme of them are necessary and tehre are few others like "Server" "...
If you are struggling with the small font size Firebug don't worry it has solution. It is configurable. This can be done via clicking firebug icon and then selecting the menu as shown in image:
There are situations when you have very large .sql files and you want to execute them. The issue comes when you have to open those files in SSMS. They start giving out of memory exceptions. The soluti...
If you have SQL Server 2012 and want to create Schema and data script for SQL Server 2008 R2 you can follow the following steps: Right click the DB. Select "Generate Scripts" Go to Set Scrip...
If you are using SQL Server Management Objects (SMO) and want to take backup of a database the following code will help you: private static void BackupDatabase(string dbName, string backupPath) { // F...
You all might be familiar with Assembly.LoadFrom method which can be use to get the version of the assembly but this method has a disadvantage as it will load the assembly into the domain and you will...
On starting IIS on my machine I was getting Cannot start service W3SVC on computer '.' message: The solution was to run the following command via command prompt: net start w3svc After running ...
I was creating sql backup via an ASP.NET application. On running the code written for creating backup I was getting the following exception: Backup Failed for Server 'xxxxx' Operating system e...
I was working with a project using SQL Server SMO to connect/communicate with SQL server. For that I needed SQL Server SMO dlls. After struggling a bit I was able to locate it and the path for those d...
While reading a config file which was present in other website from an application I was getting: Error: Cannot read configuration file due to insufficient permissions The reason for this issue was th...
There is different logic to detect IE11 in C#. It can be done via: Regex.IsMatch(current.Request.UserAgent, @"Trident/7.*rv:11") So over all IE detection can be done via: public static bool ...
This can be achieve like this: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> if (!window.jQuery) { do...
Install PHP 5.5.6 on Windows Server 2008 R2 Installing PHP on IIS 7 with Windows server 2008 can be tricky as the instructions mentioned in many official documents do not work with PHP 5.5.6. Here are...
For sample purpose I was using the js references directly from Github i.e I was using this: <script type="text/javascript" src="https://raw.github.com/WickyNilliams/headroom.js/m...
Headroom.js is a lightweight, high-performance JS widget (with no dependencies!) that allows you to react to the user's scroll. The header on this site is a living example, it slides out of view w...
If you want to get first and last date of month based on input date following code will help you: public static DateTime FirstDayOfMonth(DateTime dateTime) { return new DateTime(dateTime.Year, dateTim...