Posts

Showing posts from 2016

Merge Multiple Rows into a Single Row in SQL Server

Image
      In Some times Need Multiple Rows into  single row and combine column SQL.    this is My Table Studenttbl I Shown All RollNo And I Merge to Single Row. for Use Following SQL Query.   declare @Roll as varchar ( max )= '' select @Roll = substring (         ( select ' ,' + RollNo AS 'data()' from tbl_Studentdtl for xml path ( '' ))        , 3 , 255 )           select @Roll RoleNo

Display Doughnut Chart Using DevExpress and WebAPI

Image
In this Charts Using Web API To Know How to Value Get Value from Api  . Charts: Code <! DOCTYPE html > < html > < head >     < meta name ="viewport" content ="width=device-width" />     < title > DoughnutChartDisplay </ title >     < script src ="jquery-2.2.3.min.js"></ script >     < script src ="dx.viz-web.js"></ script >     < script type ="text/javascript">         $( function () {             $.getJSON( 'http://localhost:50879/api/name/getname' , function (data) {                 $( "#container" ).dxPieChart({                     dataSource: data,                     legend: {                         horizontalAlignment: "center" ,                         verticalAlignment: "bottom"                     },                     "export" : {              

Display Pie Chart Using DevExpress and WebAPI

Image
In this Charts Using Web API To Know  How to Value Get Value from Api  . Charts:  Code <! DOCTYPE html > < html > < head >     < meta name ="viewport" content ="width=device-width" />     < title > PieChartDisplay </ title >     < script src ="jquery-2.2.3.min.js"></ script >     < script src ="dx.viz-web.js"></ script >     < script type ="text/javascript">         $( function () {             $.getJSON( 'http://localhost:50879/api/name/getname' , function (data) {                 $( "#container" ).dxPieChart({                     dataSource: data,                     legend: {                         horizontalAlignment: "center" ,                         verticalAlignment: "bottom"                     },                     "export" : {                

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at . (Reason: CORS header 'Access-Control-Allow-Origin' missing).

Image
To Use This Code in Web.Config < system.webServer >     < httpProtocol >       < customHeaders >         < add name = " Access-Control-Allow-Origin " value = " * " />       </ customHeaders >     </ httpProtocol >   </ system.webServer > Cross-Origin Resource Sharing (CORS) Cross-Origin Resource Sharing (CORS) is a W3C Working Draft that defines how the browser and server must communicate when accessing sources across origins. The basic idea behind CORS is to use custom HTTP headers to allow both the browser and the server to know enough about each other to determine if the request or response should succeed or fail. For a simple request, one that uses either GET or POST with no custom headers and whose body is  text/plain , the request is sent with an extra header called  Origin . The  Origin header contains the origin (protocol, domain name, and port) of the requesting page so that the server

How to value get value from API using jquery

             In this Articles can works with get value from API and use in JQuery Ajax. Already Seen How to get Data from Database To Web API . Now In this section will Display The Records from API. Code < !DOCTYPE html > < html > < head >     < meta name ="viewport" content ="width=device-width" />     < title > test </ title >     < script src ="~/Scripts/jquery-1.10.2.min.js"></ script >     < script type ="text/javascript">         $( function () {             $.getJSON( 'http://localhost:50879/api/name/getname' , function (data) {                 console.log(data);                 alert(data);             })         });             </ script >                 </ head >                 < body >                     < div > </ div >                 </ body >                 </ html >

Create MVC Web API

Image
What is ASP.NET Web API?                      ASP.NET Web API is a framework for building and consuming HTTP services that can reach a broad range of clients including browsers, phones and tablets. You can use XML or JSON or something else with your API. JSON is nice for mobile apps with slow connections, for example. You can call an API from jQuery and better utilize the client's machine and browser.                        In this article we will show the basic database operations (CRUD) in an HTTP service using ASP.NET Web API. Many HTTP services also model CRUD operations through REST or REST-like APIs. 1. Create Web API Project Open Visual Studio and create "New Project" i.e. File -> New Project. Choose "ASP.NET MVC 4 Web Application" template and name project as "WebApplication1". When you click "OK" button, a new window will appear for selecting a sub-template. Actually for ASP.NET MVC 4 Web Application, we have multiple sub