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
SELECT * | |
FROM tblSites | |
GROUP BY Url | |
HAVING count(Url) = 1; |
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
$array = @("a", "b", "c", "b", "d", "a"); #Setup the array. | |
$array = $array | sort -unique; #Sort the array while using only unique values. |
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
$list = @(); #Initialize the array. | |
$list += "Apple"; #$list = "Apple" | |
$list += "Orange"; #$list = "Apple", "Orange" | |
$list += "Tomato"; #$list = "Apple", "Orange", "Tomato" | |
$list += "Grape"; #$list = "Apple", "Orange", "Tomato", "Grape" | |
$list -= "Tomato"; # ERROR!!! You can't do this! | |
#but this works | |
$list = $list -ne "Tomato"; #$list = "Apple", "Orange", "Grape" |
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
[CmdletBinding()] | |
Param ([Parameter(Mandatory=$true, HelpMessage="Current site URL?")][ValidateNotNullOrEmpty()][string]$oldUrl, | |
[Parameter(Mandatory=$true, HelpMessage="Desired new site URL?")][ValidateNotNullOrEmpty()][string]$newUrl) | |
$validate = Get-SPSite $newUrl; | |
if ($validate -eq $null) | |
{ | |
try | |
{ | |
$site = Get-SPSite $oldUrl; | |
$site.Rename($newUrl); |
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 System; | |
using System.IO; | |
using System.Text; | |
using System.Security.Cryptography; | |
using InfoPathAttachmentEncoding; | |
namespace InfoPathAttachmentEncoding | |
{ | |
/// <summary> | |
/// InfoPathAttachment encodes file data into the format expected by InfoPath for use in file attachment nodes. |
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 System; | |
using System.IO; | |
using System.Text; | |
namespace InfoPathAttachmentEncoding | |
{ | |
/// <summary> | |
/// Decodes a file attachment and saves it to a specified path. | |
/// </summary> | |
public class InfoPathAttachmentDecoder |
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
//Create an XmlNamespaceManager | |
XmlNamespaceManager ns = this.NamespaceManager; | |
//Create an XPathNavigator object for the Main data source | |
XPathNavigator xnMain = this.MainDataSource.CreateNavigator(); | |
//Create an XPathNavigator object for the attachment node | |
XPathNavigator xnAttNode = xnMain.SelectSingleNode("/my:myFields/my:theAttachmentField", ns); | |
//Obtain the text of the node. |
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
public List<System.IO.MemoryStream> getInfoPathAttachments(System.Xml.XmlDocument InfoPathDocument, string nodePath) | |
{ | |
/// <summary> | |
/// Grab multiple attachments from an InfoPath form and | |
/// return them in a list of memory streams. | |
/// </summary> | |
List<System.IO.MemoryStream> files = new List<MemoryStream>(); | |
System.Xml.XmlNamespaceManager nm = new System.Xml.XmlNamespaceManager(InfoPathDocument.NameTable); | |
nm.AddNamespace("my", "http://schemas.microsoft.com/office/infopath/2003/myXSD/2014-07-12T15:29:09"); |
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
catch (Exception ex) | |
{ | |
if (ex is System.Reflection.ReflectionTypeLoadException) | |
{ | |
var typeEx = ex as ReflectionTypeLoadException; | |
var loadEx = typeEx.LoaderExceptions; | |
//Do something with loadEx | |
} | |
} |
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
<configuration> | |
<system.web> | |
<compilation> | |
<assemblies> | |
<add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"/> | |
</assemblies> | |
</compilation> | |
</system.web> | |
</configuration> |
OlderNewer