Skip to content

Instantly share code, notes, and snippets.

View karenpayneoregon's full-sized avatar
🎯
Focusing

Karen Payne karenpayneoregon

🎯
Focusing
View GitHub Profile
@karenpayneoregon
karenpayneoregon / NorthWind2020OrderDetails.sql
Created July 10, 2020 16:11
Get order items by order id
DECLARE @OrderIdentifier INT= 10248;
SELECT p.ProductName,
od.ProductID,
od.UnitPrice,
od.Quantity,
od.Discount
FROM OrderDetails AS od
INNER JOIN Products AS p ON od.ProductID = p.ProductID
WHERE od.OrderID = @OrderIdentifier;
@karenpayneoregon
karenpayneoregon / NorthWind2020ProductsByCategory.sql
Last active July 11, 2020 12:10
Get products by category for NorthWind2020
DECLARE @CategoryID INT= 2;
SELECT P.ProductID,
P.ProductName,
P.UnitPrice,
P.UnitsInStock,
P.SupplierID,
S.CompanyName AS SupplierName,
C.[Name] AS SupplierCountry
FROM Products AS P
INNER JOIN Suppliers AS S ON P.SupplierID = S.SupplierID
@karenpayneoregon
karenpayneoregon / NorthWind2020Employees.sql
Created July 11, 2020 12:09
Get employees for NorthWind2020
SELECT E.EmployeeID,
E.TitleOfCourtesy,
E.LastName,
E.FirstName,
CT.ContactTitle,
CONVERT(VARCHAR, E.BirthDate, 1) AS BirthDate,
CONVERT(VARCHAR, E.HireDate, 1) AS HireDate,
E.Address AS Street,
E.City,
E.Region,
@karenpayneoregon
karenpayneoregon / ApplicationServices.cs
Last active August 5, 2020 20:43
Create desktop shortcut
using System;
using System.IO;
using System.Reflection;
namespace ApplicationShortCut
{
public class ApplicationServices
{
private static readonly string DesktopFolder =
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
@karenpayneoregon
karenpayneoregon / ResourceImage.vb
Created September 8, 2020 01:46
Get resource images for VB.NET
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ListBox1.DisplayMember = "Name"
ListBox1.DataSource = ResourceImages.GetInstance().BitMaps()
End Sub
Private Sub GetImageButton_Click(sender As Object, e As EventArgs) Handles GetImageButton.Click
PictureBox1.Image = ResourceImages.GetInstance().GetSingleBitMap(ListBox1.Text)
End Sub
End Class
using System.Text.RegularExpressions;
namespace Validators
{
public static class ValidateExtensions
{
/// <summary>
/// Validate
/// Don't allow "219-09-999" or "078-05-1120" explicitly
@karenpayneoregon
karenpayneoregon / html.json
Last active November 15, 2020 17:36
VS Code HTML Snippets (ongoing)
{
"document ready empty": {
"prefix": "dre",
"body": [
"<script>",
" $(document).ready(function() {",
" ${0:}",
" });",
"</script>"
],
@karenpayneoregon
karenpayneoregon / ControlExtensions.cs
Created November 27, 2020 23:07
Extension methods to collect controls in windows forms
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DescendantsLibrary
{
public static class ControlExtensions
@karenpayneoregon
karenpayneoregon / NorthWind2020_1.sql
Last active July 20, 2021 17:25
NorthWind 2020 updated with additional tables and indices
This file has been truncated, but you can view the full file.
USE [master]
GO
/****** Object: Database [NorthWind2020] Script Date: 7/20/2021 10:25:30 AM ******/
CREATE DATABASE [NorthWind2020]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'NorthWind2020', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\DATA\NorthWind2020.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
LOG ON
( NAME = N'NorthWind2020_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\DATA\NorthWind2020_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
GO
@karenpayneoregon
karenpayneoregon / ImageHelpers.cs
Created December 20, 2020 00:32
Convert SQL-Server image to Image
using System.Drawing;
using System.IO;
namespace UtilityLibrary
{
/// <summary>
///
/// </summary>
/// <remarks>
/// Requires NuGet package