Translate

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:



Thursday, 17 December 2015

How to Bind Table Using Angular JS

Bind Table Using Angular JS

View:


<div ng-app="repeatTable" ng-controller="practiece1" id="App4">
        <table >
            <tr >
                <td>Id</td>
                <td>User Name</td>
                <td>First Name</td>
                 <td>Last Name</td>
                 <td>Location</td>
            </tr>
            <tr ng-repeat="data in tabledata" style="border: solid">
                <td>{{data.Id}}</td>
                <td>{{data.UserName}}</td>
                <td>{{data.FirstName}}</td>
                 <td>{{data.LastName}}</td>
                 <td>{{data.Location}}</td>
            </tr>
        </table>

    </div>

<script>
  var aps = angular.module('repeatTable', []).controller('practiece1', function ($scope, $http) {
            alert("");
            $http.get('/AngularJS/TableData').success(function (data) {
                alert(data);
                $scope.tabledata = data;
            });

        });
</script>


In Controller:

    public ActionResult TableData()
        {
            var text = context.UserInfoes.ToList();
            return Json(text,JsonRequestBehavior.AllowGet);
        }