Monday, 2 February 2015

How to clear div content in jquery

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("#div1").empty();
    });
});
</script>
</head>
<body>

<div id="div1">
  Smoe text
</div>

<br>
<br>
<button>Remove</button>

</body>
</html>

Thursday, 29 January 2015

How to validate double value in c#.net


 Add namespace: using System.Text.RegularExpressions;



if (Regex.IsMatch(txt_number.Text, @"\d+(\.\d{1,2})?"))
{
    //valid Number
    // Do something with value
}
else
{
    //invalid Number
    lbl_error.Text = "Please enter a valid number";
    return;
}

Int value validation in c#.net

            int parsedValue;
            if (int.TryParse(txt_number.Text, out parsedValue))
            {

                //valid Number
                // Do something with value
            }
            else
            {
                //invalid Number
                lbl_error.Text = "Please enter a valid number";
                return;
            }

Decimal number validation in c#.net

           decimal d;
            if (decimal.TryParse(txt_number.Text, out d))
            {
                //valid Number
                // Do something with value
            }
            else
            {
                //invalid Number
                                lbl_error.Text = "Please enter a valid number";
                return;
            }

Tuesday, 19 August 2014

how to set file upload size in web.config

<configuration>
  <system.web>
    <httpRuntime maxRequestLength="1024" />
  </system.web>
</configuration>

Thursday, 14 August 2014

How to uninstall SQL Server 2008 from Windows 7

To Remove SQL Server 2008 from Windows 7, do the following steps
1. Go to Control Panel | Program | Uninstall Programs |Microsoft SQL Server 2008 R2 (64-bit) | and click on Uninstall
Uninstall SQL Server 2008 from Windows

2. You will get option to Add/Repair and Remove SQL Server 2008 . Click Remove
Remove/uninstall SQL 2008 Server
3.  Once Setup Support Rules completed, click OK  
Setup support rules to uninstall SQL Server 2008

4. Select Instance to remove
Select the instance of SQL Server to remove. To remove Management Tools and Shared Features only, Select
Remove Shared Features only and then click next.
Select Instance to remove SQL Server 2008

5. Select the features to remove
The SQL Server Features on this computer are shown below. To remove a feature, select the checkbox next to the feature name
Select Features to Uninstall SQL 2008 Server
6.  Click next to Removal Rules and your system is ready to Remove SQL Server 2008
Ready to Uninstall SQL 2008 Server
7. Removal of SQL Server 2008 R2 from Windows 7 computer
Removal of SQL Server 2008 R2

8.  Complete: Your SQL Server 2008 R2 Removal Completed Successfully.

your-slq-server-2008-r2-removal-completed-successfully

Wednesday, 13 August 2014

When was the last successful backup in sqlserver?

Just right click on the Database and click on properties on the sql management studio.

http://adidotnettotal.blogspot.in/2014/08/when-was-last-successful-backup-in.html


On top of window the last full backup completion time and log backup completion time is shown.This is the simplest way of finding the success of a daily backup without even typing a command.