CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets for: jaredmroberts
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Web;
 
/// <summary>
/// Summary description for OrderByHelper
/// </summary>
by jaredmroberts   January 12, 2012 @ 4:49pm
21 Views
no comments
 
C#
SPListItem item = properties.ListItem;
 
SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Customer");
SPFieldUserValue fieldValue = (SPFieldUserValue)userField.GetFieldValue(item[userField.ID].ToString());
string customerEmail = fieldValue.User.Email;
by jaredmroberts   December 15, 2011 @ 1:35pm
54 Views
no comments
 
SQL
SELECT o.name, c.text FROM sysobjects o INNER JOIN syscomments c ON o.id = c.id  
 WHERE xtype = 'P' AND CharIndex('<KEYWORD>',c.text) > 0 ORDER BY o.name
by jaredmroberts   December 02, 2011 @ 3:38pm
Tags: t-sql
39 Views
no comments
 
C#
List<Product> products = new List<Product>();
 
products.Sort(delegate(Product p1, Product p2)
{
return p1.ProductName.CompareTo(p2.ProductName);
});
by jaredmroberts   October 21, 2011 @ 8:49am
Tags: List<>, Sort
44 Views
no comments
 
C#
   public static UserPrincipal GetUserAdInfo(string domainName, string loginName)
   {
       PrincipalContext ctx = new PrincipalContext(ContextType.Domain, domainName);
 
       UserPrincipal user = UserPrincipal.FindByIdentity(ctx, loginName); 
 
       if(user != null) 
       {
           return user;
       }
by jaredmroberts   September 30, 2011 @ 4:24pm
69 Views
no comments
 
$.ajax({
  url: 'Service.asmx/Method',
  type: 'POST',
  contentType: 'application/json',
  data: '{"Parameters":"Must be JSON strings!"}',
  success: function(response) {
    // Don't forget that the response is wrapped in a
    //  ".d" object in ASP.NET 3.5 and later.
    console.log(response.d);
  }
by jaredmroberts   June 14, 2011 @ 10:16am
99 Views
no comments
 
SQL
SELECT * FROM OPENQUERY(ADSI, 
'SELECT objectCategory, cn, givenName, sn, mail, name, department,SAMAccountName FROM 
''LDAP://DC=<<DOMAIN>>,DC=<<COM,LOCAL,NET>>'' 
WHERE  objectClass = ''group'' ORDER BY cn')
AS ADGroups
by jaredmroberts   June 08, 2011 @ 4:03pm
Tags: AD, T-SQL
148 Views
no comments
 
SQL
declare @Field1 nvarchar(255)
declare CursorFile cursor for
    SELECT field1 from MyTable
OPEN CursorFile
FETCH NEXT FROM CursorFile 
INTO @Field1
WHILE @@FETCH_STATUS = 0
BEGIN
  
  FETCH NEXT FROM CursorFile INTO @Field1
by jaredmroberts   June 06, 2011 @ 8:41am
Tags: Cursor
81 Views
no comments
 
SQL
CREATE FUNCTION [dbo].[udf_StringToTable]
(
    @string VARCHAR(MAX),
    @delimiter CHAR(1)
)
RETURNS @output TABLE(
    data VARCHAR(256)
)
BEGIN
by jaredmroberts   May 31, 2011 @ 11:01am
89 Views
no comments
 
SQL
USE [DBNAME]
 
SELECT name INTO #UsersTemp FROM sys.sysusers Where issqluser=1 and name not in (
'dbo',
'guest',
'INFORMATION_SCHEMA',
'sys',
'sysadm')
 
USE [DBNAME]
by jaredmroberts   April 26, 2011 @ 12:52pm
Tags:
92 Views
no comments
 
function checkEmail(inputvalue){    
    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    if(pattern.test(inputvalue)){         
        return true;   
    }else{   
        return false; 
    }
}
by jaredmroberts   January 28, 2011 @ 2:52pm
172 Views
no comments
 
$("#loading_animation").bind({
    ajaxStart: function() { $(this).show(); },
    ajaxStop: function() { $(this).hide(); }
});
by jaredmroberts   January 28, 2011 @ 1:00pm
495 Views
no comments
 
Public Class ProjectInstaller
 
    Private Const LOG_SOURCE As String = "Log"
    Private Const LOG_LOG As String = "Log"
    Private _mainEventLog As EventLog
 
    Public Sub New()
        MyBase.New()
 
        'This call is required by the Component Designer.
580 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate