Translate

Monday, 6 June 2016

How to set data to LocaStorage and get data from LocalStorage

Set data to LocaStorage and get data from LocalStorage:


Set Data
 <script>
             
            window.localStorage.setItem("Property", "Sample Data");
    </script>

Get Data:
<script>
             
           alert(window.localStorage.getItem("Property"))
</script>

We can check local storage values in





Thursday, 5 May 2016

How to change Some part of Column data as upper using SQL SERVER

How to change Some part of Column data as upper using SQL SERVER


  update Employe set name= Upper(substring(name,0,charindex('(',name)))+ ' '+ SUBSTRING(name, CHARINDEX('(', name) , CHARINDEX(')', name) - CHARINDEX('(', name)+1) where charindex('(',name,0)>0
  update Employe set name= Upper(name) where charindex('(',name,0)=0


The Out put like below


Wednesday, 27 April 2016

Access WCF service using Jquery Ajax and C#.Net

How to access WCF service Using Jquery ajax and C#.net

For Reference
https://debugmode.net/2011/12/22/how-to-enable-rest-and-soap-both-on-the-same-wcf-service/





<script>
    $(document).ready(function () {
        var URL = "http://sample/service.svc/Check_Session";
        $.ajax({
            type: 'GET',
            url: URL,
            dataType: 'json',
            crossDomain: true,
            success: function (data) {
                if (data.Message != "Success") {
                    alert("success");
                }
                else {
                  
                    alert("Fail");
                }
            },
            error: function (ex) {
                console.log("err");
            }
        });
    });

</script>

Thursday, 21 April 2016

Add proxy class for wcf service through Visual studio Command promt



Open VS command Prompt and  give path of svcutil
 and add service


see the below url for ur reference
http://www.codeproject.com/Articles/786601/Ways-to-generate-proxy-for-WCF-Service

Sunday, 14 February 2016

Encrypt and Decrypt Connectionstring and AppSettings Sections in web.config


Encrypt:

aspnet_regiis.exe -pef "appSettings" "D:\Sample\WebSite1" -prov "DataProtectionConfigurationProvider"


aspnet_regiis.exe -pef "connectionStrings" "D:\Sample\WebSite1" -prov "DataProtectionConfigurationProvider"

Decrypt:

aspnet_regiis.exe -pdf "appSettings" "D:\Sample\WebSite1"


aspnet_regiis.exe -pdf "connectionStrings" "D:\Sample\WebSite1" 

Sunday, 10 January 2016

Access Resource values for db values





 ddlState.Items(index).Value = ds.Tables(0).Rows(index)("Region_Code")
                ddlState.Items(index).Text = GetLocalResourceObject(ds.Tables(0).Rows(index)("Resource_key").ToString() + ".Text").ToString

Monday, 4 January 2016

Jquery Text Easy Counter



Jquery text easy Counter shown below




<h2>EasyCountrer</h2>
<script src="~/Scripts/jquery-1.7.1.min.js"></script>
<script src="~/Content/js/jquery.jqEasyCharCounter.min.js"></script>


<textarea id="easy" ></textarea>
<script>
    $(document).ready(function () {
        $("#easy").jqEasyCounter(
            {
                'maxChars': 160,
                        'maxCharsWarning': 150
            });
    });

</script>

OutPut: