Loading ...

ASP.NET Blogs | CodeAsp.Net - Page 3

  • VS2012: Unable to open database project
    I tried creating a database project todat in VS2012 but was encountered with the following error: Unable to open Database Project This version of SQL Server Data Tools is not compatible with the database runtime components installed on this computer. The solution was to install the lastest version Data tools from here http://msdn.microsoft.com/en-u
    Raghav Khunger  · 1/16/2014  · 0  · 2784
    visual-studio-2012
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will help you how to delete duplicate rows from a table where there is no primary key in the table. Below is the script to insert data: CREATE TABLE MyTable ( Col1 INT , Col2 VARCHAR(10) , Col3 VARCHAR(11) ); GO INSERT INTO MyTable VALUES ( 1, 'Jack', '555-55-5555' ); INSERT INTO MyTable VALUES ( 2, 'Joe', &am
    Raghav Khunger  · 1/13/2014  · 0  · 3056
    Sql sql-server
     /5
    Avg: 0 / 5 (0votes)
  • If you are facing 404 error while accessing iso extension file this blog will help you. You need to add following code in your web.config: <remove fileExtension=".iso" /> <mimeMap fileExtension=".iso" mimeType="application/octet-stream" /> Here is the location wehere to add the same:
    Raghav Khunger  · 1/12/2014  · 0  · 2533
    asp.net web.config mine-type
     /5
    Avg: 0 / 5 (0votes)
  • If you want to resize the hiberfil.sys on your machine running on Windows 7 you need to run following command: powercfg -h -size 50 Above 50 is the percentage by which you want to reduce
    Raghav Khunger  · 1/9/2014  · 1  · 2367
    windows-7 hibernate
     /5
    Avg: 0 / 5 (0votes)
  • Windows7: Enable Hibernation
    If you want to enable hibernation on your machine running on Windows 7 you need to run following command: powercfg -h on You can verify whether the above command was successfull or not by checking start menu. Hibernation option should be visible now.
    Raghav Khunger  · 1/9/2014  · 0  · 2241
    windows-7 hibernate
     /5
    Avg: 0 / 5 (0votes)
  • Windows7: Disable Hibernation
    If you want to disable hibernation on your machine running on Windows 7 you need to run following command: powercfg -h off You can verify whether the above command was successfull or not by checking start menu. Hibernation option should be gone now.
    Raghav Khunger  · 1/9/2014  · 0  · 2171
    windows-7 hibernate
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to replace single backslash with double backslash in a string with REGEX. Let's say we have a string "This is \ test \ string" and we want to replace single backslash with double backslash so that the output comes "This is \\ test \\ string". Below is the sample code to do the same: using System;
    Raghav Khunger  · 1/9/2014  · 0  · 3018
    c# regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to replace uppercase letter with "underscore and the letter "in a string with REGEX. Let's say we have a string "ThisIsTestString" and we want to replace uppercase letter with "underscore and the letter" so that the output comes "_This_Is_Test_String". Below is the sample code
    Raghav Khunger  · 1/9/2014  · 0  · 2926
    c# regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to replace underscores with hyphens in a string with REGEX. Let's say we have a string "This_is_test_string" and we want to replace underscores with hyphens so that the output comes "This-is-test-string". Below is the sample code to do the same: using System; using System.Linq; using System.Text.
    Raghav Khunger  · 1/9/2014  · 0  · 2255
    regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to get number only from a string with REGEX. Let's say we have a string "Hello 123456789 user 456 welcome." and we want the output to be "123456789456". Below is the sample code to do the same: using System; using System.Linq; using System.Text.RegularExpressions; namespace SampleConsoleApplicati
    Raghav Khunger  · 1/8/2014  · 0  · 2309
    regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to validate a string to allow alphanumeric characters only in a string with REGEX. Below is the sample code to do the same: using System; using System.Text.RegularExpressions; namespace SampleConsoleApplication { class Program { static void Main(string[] args) { Regex regex = new Regex("^[a-zA-Z0-9]*$"); //Fir
    Raghav Khunger  · 1/8/2014  · 0  · 2477
    c# regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to remove all non numeric characters from a string with REGEX. Let's say we have a string "(912)-555-7777" and remove all non numeric characters so that the string looks like "9125557777". Below is the sample code to do the same: using System; using System.Text.RegularExpressions; namespace Sampl
    Raghav Khunger  · 1/7/2014  · 0  · 2170
    c# regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to remove all non alpha numeric characters from a string with REGEX. Let's say we have a string "Hello!@#$123456789~~-_user456welcome" and remove all non alpha numeric characters so that the string looks like "Hello123456789user456welcome". Below is the sample code to do the same: using System; u
    Raghav Khunger  · 1/7/2014  · 0  · 2953
    c# regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to reverse all numbers in string with REGEX. Let's say we have a string "Hello 123456789 user 456 welcome." and we want to reverse it like "Hello 987654321 user 654 welcome.". Below is the sample code to do the same: using System; using System.Linq; using System.Text.RegularExpressions; namespace
    Raghav Khunger  · 1/6/2014  · 0  · 2048
    c# regex
     /5
    Avg: 0 / 5 (0votes)
  • I encountered a piece of code where regex replacement was done in the following way: Regex.Replace(@"\d+", m => new string(m.Value.Reverse().ToArray())); It was giving the following error: Can not access non-static method Replace in static context The issue with the above code was that the inputstring parameter was missing. The osl
    Raghav Khunger  · 1/6/2014  · 0  · 2410
    c# regex
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to replace multiple spaces with a single space with REGEX. Let's say we have a string "a b c d e f g" and we want to replace multiple spaces with a single space so that the output comes "a b c d e f g". Below is the sample code to do the same: using System; using System.Text.RegularExpressions; n
    Raghav Khunger  · 1/6/2014  · 0  · 1916
    regex
     /5
    Avg: 0 / 5 (0votes)
  • Plugin com.intellij failed to initialize and will be disabled: null
    I was getting the folowing screen while loading IntelliJ IDEA editor: Plugin com.intellij failed to initialize and will be disabled: null The solution for this issue was to set the JAVA_HOME path in Environment variables like below: For me the path was at following location C:\Program Files\Java\jdk1.7.0_25
    Raghav Khunger  · 1/5/2014  · 0  · 2884
    intellij-idea
     /5
    Avg: 0 / 5 (0votes)
  • In this blog I will show how to validate whether a string is a valid IP address not with REGEX. Below is the sample code to check the same: using System; using System.Text.RegularExpressions; namespace SampleConsoleApplication { class Program { static void Main(string[] args) { const string inputString = "192.168.1.1"; Regex regex = new R
    Raghav Khunger  · 1/3/2014  · 0  · 5129
     /5
    Avg: 0 / 5 (0votes)
  • Let's say we have a string and we want to match that string not containing a word say alpha . I have used Regex class in order to do so
    Raghav Khunger  · 1/3/2014  · 0  · 12604
    regex
     /5
    Avg: 0 / 5 (0votes)
  • I encountered with a piece of code today where anchor tag was having label tag inside it like this: <a href="/targeturl" class="no-underline"> <label> Dummy Text </label> </a> The issue with the above code was that the anchor click was not working in IE. The culprit for thi
    Raghav Khunger  · 1/2/2014  · 0  · 2576
    anchor
     /5
    Avg: 0 / 5 (0votes)
  • 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 Firebug inspector it was also cleared that images were ate the correct locatoion? So what was the issue? It turns out that the Contrast of the screen was to
    Raghav Khunger  · 12/30/2013  · 0  · 1419
     /5
    Avg: 0 / 5 (0votes)
  • 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.I​O Library (V4.0) http://gallery.technet.microsoft.com/DelimonWin32IO-Library-V40-7ff6b16c This Library is written specifically to overcome the limitation of the .NE
    Raghav Khunger  · 12/27/2013  · 0  · 1450
    c#
     /5
    Avg: 0 / 5 (0votes)
  • File.Move: Access to the path is denied
    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.UnauthorizedAccessException: Access to the path is denied. The fix for this was to give IIS_USRS account full control permissions: After giving the pe
    Raghav Khunger  · 12/27/2013  · 0  · 2974
    asp.net c# file-move
     /5
    Avg: 0 / 5 (0votes)
  • Removing "X-Powered-By" HTTP Header in ASP.NET
    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 code in the system.webserver section of web.config file of your application: <httpProtocol> <customHeaders> <remove na
    Raghav Khunger  · 12/27/2013  · 0  · 3801
    iis-7
     /5
    Avg: 0 / 5 (0votes)
  • Removing "Server" "X-AspNet-Version" HTTP Headers in ASP.NET
    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" "X-AspNet-Version" which can be removed as they can pose a security risk. Here is the screenshot of Response Header for a nomal request to IIS se
    Raghav Khunger  · 12/27/2013  · 0  · 1325
    iis-7
     /5
    Avg: 0 / 5 (0votes)
Clear filter

Filter blogs

Top Producers

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?