This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Tablename NVARCHAR(255) = 'MyTable' | |
DECLARE @IdColumn NVARCHAR(255) = 'MyTableId' -- Primarykey-Column, will be ignored | |
DECLARE @IdToCopyFrom VARCHAR(255) = '33' -- Copy from this ID | |
DECLARE @ColName NVARCHAR(255) | |
DECLARE @SQL NVARCHAR(MAX) = '' | |
DECLARE Table_Cursor CURSOR FOR | |
SELECT [B].[Name] | |
FROM SYSOBJECTS AS [A], SYSCOLUMNS AS [B] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (var client = new HttpClient()) | |
{ | |
var message = new HttpRequestMessage(HttpMethod.Post, url); | |
message.Headers.Add("Authorization", authKey); | |
message.Headers.Add("Audit",auditKey); | |
message.Content = new StringContent(content, new UTF8Encoding(), "application/json"); | |
var response = client.SendAsync(message).Result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax( | |
{ | |
url: _spPageContextInfo.webServerRelativeUrl + "/_api/web/currentuser", | |
type: "GET", | |
headers: { | |
"accept": "application/json;odata=verbose", | |
}, | |
success: function (data) { | |
$("#message").text('Hello ' + data.d.Title); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[WebService(Namespace = "Foo")] | |
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] | |
[System.ComponentModel.ToolboxItem(false)] | |
[System.Web.Script.Services.ScriptService] | |
public class GetData : System.Web.Services.WebService | |
{ | |
[WebMethod] | |
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)] | |
public string GetInfo() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
$.ajax({ | |
type: 'GET', | |
url: 'http://localhost:63751/Service1.svc/json/4', | |
dataType: 'json', | |
crossDomain: true, | |
async: true, | |
success: function (data) { | |
jsonData = data; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Application_BeginRequest(object sender, EventArgs e) | |
{ | |
HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); | |
if (HttpContext.Current.Request.HttpMethod == "OPTIONS") | |
{ | |
HttpContext.Current.Response.AddHeader("Cache-Control", "no-cache"); | |
HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST"); | |
HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept, TenantId"); // TenantId could be anything | |
HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000"); | |
HttpContext.Current.Response.End(); |
OlderNewer