mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
initial checkin of workload drivers
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="MultithreadedOrderInsert.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<MultithreadedOrderInsert.Properties.Settings>
|
||||
<setting name="WWI_ConnectionString" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</MultithreadedOrderInsert.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
partial class ErrorDetailsForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.MainMessageTextBox = new System.Windows.Forms.TextBox();
|
||||
this.DetailedErrorMessageTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.OKButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// MainMessageTextBox
|
||||
//
|
||||
this.MainMessageTextBox.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.MainMessageTextBox.Location = new System.Drawing.Point(29, 12);
|
||||
this.MainMessageTextBox.Multiline = true;
|
||||
this.MainMessageTextBox.Name = "MainMessageTextBox";
|
||||
this.MainMessageTextBox.Size = new System.Drawing.Size(942, 55);
|
||||
this.MainMessageTextBox.TabIndex = 1;
|
||||
this.MainMessageTextBox.TabStop = false;
|
||||
this.MainMessageTextBox.Text = "This program is meant to be used to provide an intense order entry insert workloa" +
|
||||
"d for the WideWorldImporters database. Please check that you are connected to a " +
|
||||
"valid copy of that database.";
|
||||
//
|
||||
// DetailedErrorMessageTextBox
|
||||
//
|
||||
this.DetailedErrorMessageTextBox.BackColor = System.Drawing.Color.LightCyan;
|
||||
this.DetailedErrorMessageTextBox.Location = new System.Drawing.Point(29, 105);
|
||||
this.DetailedErrorMessageTextBox.Multiline = true;
|
||||
this.DetailedErrorMessageTextBox.Name = "DetailedErrorMessageTextBox";
|
||||
this.DetailedErrorMessageTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.DetailedErrorMessageTextBox.Size = new System.Drawing.Size(942, 294);
|
||||
this.DetailedErrorMessageTextBox.TabIndex = 2;
|
||||
this.DetailedErrorMessageTextBox.TabStop = false;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(26, 86);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(165, 16);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "Detailed error message:";
|
||||
//
|
||||
// OKButton
|
||||
//
|
||||
this.OKButton.Location = new System.Drawing.Point(446, 417);
|
||||
this.OKButton.Name = "OKButton";
|
||||
this.OKButton.Size = new System.Drawing.Size(125, 37);
|
||||
this.OKButton.TabIndex = 6;
|
||||
this.OKButton.Text = "&OK";
|
||||
this.OKButton.UseVisualStyleBackColor = true;
|
||||
this.OKButton.Click += new System.EventHandler(this.OKButton_Click);
|
||||
//
|
||||
// ErrorDetailsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1017, 466);
|
||||
this.Controls.Add(this.OKButton);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.DetailedErrorMessageTextBox);
|
||||
this.Controls.Add(this.MainMessageTextBox);
|
||||
this.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ErrorDetailsForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Error Details";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.ErrorDetailsForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox MainMessageTextBox;
|
||||
private System.Windows.Forms.TextBox DetailedErrorMessageTextBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button OKButton;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
public partial class ErrorDetailsForm : Form
|
||||
{
|
||||
public string ErrorMessage;
|
||||
|
||||
public ErrorDetailsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ErrorDetailsForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
DetailedErrorMessageTextBox.Text = this.ErrorMessage;
|
||||
}
|
||||
|
||||
private void OKButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{35325643-119B-40C9-9F95-BE22CB062599}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MultithreadedOrderInsert</RootNamespace>
|
||||
<AssemblyName>MultithreadedOrderInsert</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ErrorFormMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ErrorFormMain.Designer.cs">
|
||||
<DependentUpon>ErrorFormMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MultithreadedOrderInsertMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MultithreadedOrderInsertMain.Designer.cs">
|
||||
<DependentUpon>MultithreadedOrderInsertMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="ErrorFormMain.resx">
|
||||
<DependentUpon>ErrorFormMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MultithreadedOrderInsertMain.resx">
|
||||
<DependentUpon>MultithreadedOrderInsertMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
partial class MultithreadedOrderInsertMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MultithreadedOrderInsertMain));
|
||||
this.DescriptionTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.ConnectionStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.InsertButton = new System.Windows.Forms.Button();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.NumberOfThreadsNumericUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.AverageOrderInsertionTimeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.DisplayUpdateTimer = new System.Windows.Forms.Timer(this.components);
|
||||
((System.ComponentModel.ISupportInitialize)(this.NumberOfThreadsNumericUpDown)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// DescriptionTextBox
|
||||
//
|
||||
this.DescriptionTextBox.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.DescriptionTextBox.Location = new System.Drawing.Point(13, 13);
|
||||
this.DescriptionTextBox.Multiline = true;
|
||||
this.DescriptionTextBox.Name = "DescriptionTextBox";
|
||||
this.DescriptionTextBox.Size = new System.Drawing.Size(1065, 55);
|
||||
this.DescriptionTextBox.TabIndex = 0;
|
||||
this.DescriptionTextBox.TabStop = false;
|
||||
this.DescriptionTextBox.Text = resources.GetString("DescriptionTextBox.Text");
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(13, 91);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(141, 17);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Connection String:";
|
||||
//
|
||||
// ConnectionStringTextBox
|
||||
//
|
||||
this.ConnectionStringTextBox.Location = new System.Drawing.Point(13, 123);
|
||||
this.ConnectionStringTextBox.Name = "ConnectionStringTextBox";
|
||||
this.ConnectionStringTextBox.Size = new System.Drawing.Size(1065, 24);
|
||||
this.ConnectionStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// InsertButton
|
||||
//
|
||||
this.InsertButton.Location = new System.Drawing.Point(431, 264);
|
||||
this.InsertButton.Name = "InsertButton";
|
||||
this.InsertButton.Size = new System.Drawing.Size(125, 37);
|
||||
this.InsertButton.TabIndex = 5;
|
||||
this.InsertButton.Text = "&Insert";
|
||||
this.InsertButton.UseVisualStyleBackColor = true;
|
||||
this.InsertButton.Click += new System.EventHandler(this.InsertButton_Click);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(13, 178);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(150, 17);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Number of Threads:";
|
||||
//
|
||||
// NumberOfThreadsNumericUpDown
|
||||
//
|
||||
this.NumberOfThreadsNumericUpDown.Location = new System.Drawing.Point(187, 178);
|
||||
this.NumberOfThreadsNumericUpDown.Maximum = new decimal(new int[] {
|
||||
250,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.NumberOfThreadsNumericUpDown.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.NumberOfThreadsNumericUpDown.Name = "NumberOfThreadsNumericUpDown";
|
||||
this.NumberOfThreadsNumericUpDown.Size = new System.Drawing.Size(120, 24);
|
||||
this.NumberOfThreadsNumericUpDown.TabIndex = 1;
|
||||
this.NumberOfThreadsNumericUpDown.Value = new decimal(new int[] {
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(715, 185);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(320, 17);
|
||||
this.label5.TabIndex = 9;
|
||||
this.label5.Text = "Average Order Insertion Time (Milliseconds):";
|
||||
//
|
||||
// AverageOrderInsertionTimeTextBox
|
||||
//
|
||||
this.AverageOrderInsertionTimeTextBox.BackColor = System.Drawing.Color.PeachPuff;
|
||||
this.AverageOrderInsertionTimeTextBox.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.AverageOrderInsertionTimeTextBox.Location = new System.Drawing.Point(782, 221);
|
||||
this.AverageOrderInsertionTimeTextBox.Name = "AverageOrderInsertionTimeTextBox";
|
||||
this.AverageOrderInsertionTimeTextBox.Size = new System.Drawing.Size(220, 46);
|
||||
this.AverageOrderInsertionTimeTextBox.TabIndex = 10;
|
||||
this.AverageOrderInsertionTimeTextBox.TabStop = false;
|
||||
//
|
||||
// DisplayUpdateTimer
|
||||
//
|
||||
this.DisplayUpdateTimer.Interval = 1000;
|
||||
this.DisplayUpdateTimer.Tick += new System.EventHandler(this.DisplayUpdateTimer_Tick);
|
||||
//
|
||||
// MultithreadedOrderInsertMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1107, 345);
|
||||
this.Controls.Add(this.AverageOrderInsertionTimeTextBox);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.NumberOfThreadsNumericUpDown);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.InsertButton);
|
||||
this.Controls.Add(this.ConnectionStringTextBox);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.DescriptionTextBox);
|
||||
this.Font = new System.Drawing.Font("Verdana", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "MultithreadedOrderInsertMain";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Multithreaded Order Insert Main";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MultithreadedOrderInsertMain_FormClosing);
|
||||
this.Load += new System.EventHandler(this.MultithreadedOrderInsertMain_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.NumberOfThreadsNumericUpDown)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox DescriptionTextBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox ConnectionStringTextBox;
|
||||
private System.Windows.Forms.Button InsertButton;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.NumericUpDown NumberOfThreadsNumericUpDown;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox AverageOrderInsertionTimeTextBox;
|
||||
private System.Windows.Forms.Timer DisplayUpdateTimer;
|
||||
}
|
||||
}
|
||||
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
public partial class MultithreadedOrderInsertMain : Form
|
||||
{
|
||||
public bool errorHasOccurred;
|
||||
public string errorDetails;
|
||||
|
||||
private Thread[] sqlTasks;
|
||||
private Int64 totalOrders;
|
||||
private Int64 totalMilliseconds;
|
||||
|
||||
public MultithreadedOrderInsertMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void MultithreadedOrderInsertMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionStringTextBox.Text = MultithreadedOrderInsert.Properties.Settings.Default.WWI_ConnectionString;
|
||||
if (ConnectionStringTextBox.Text.Length == 0)
|
||||
{
|
||||
ConnectionStringTextBox.Text = "Server=.;Database=WideWorldImporters;Integrated Security=true;Column Encryption Setting=disabled;Max Pool Size=250;";
|
||||
}
|
||||
}
|
||||
|
||||
private void MultithreadedOrderInsertMain_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
MultithreadedOrderInsert.Properties.Settings.Default.WWI_ConnectionString = ConnectionStringTextBox.Text;
|
||||
MultithreadedOrderInsert.Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
public void UpdateTotals(int MillisecondsForOrder)
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
this.totalOrders += 1;
|
||||
this.totalMilliseconds += MillisecondsForOrder;
|
||||
}
|
||||
}
|
||||
|
||||
private void InsertButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (InsertButton.Text == "&Insert")
|
||||
{
|
||||
InsertButton.Text = "&Stop Now";
|
||||
InsertButton.Refresh();
|
||||
this.Refresh();
|
||||
|
||||
DisplayUpdateTimer.Enabled = true;
|
||||
|
||||
this.errorHasOccurred = false;
|
||||
this.errorDetails = "";
|
||||
|
||||
this.totalOrders = 0;
|
||||
this.totalMilliseconds = 0;
|
||||
|
||||
if (ConnectionStringTextBox.Text.Length == 0)
|
||||
{
|
||||
ConnectionStringTextBox.Text = "Server=.;Database=WideWorldImporters;Integrated Security=true;Column Encryption Setting=disabled;Max Pool Size=250;";
|
||||
}
|
||||
|
||||
if (!ConnectionStringTextBox.Text.ToUpper().Contains("MAX POOL SIZE"))
|
||||
{
|
||||
ConnectionStringTextBox.Text = (ConnectionStringTextBox.Text + ";Max Pool Size=250;").Replace(";;", ";");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
int numberOfThreads = (int)NumberOfThreadsNumericUpDown.Value;
|
||||
|
||||
sqlTasks = new Thread[numberOfThreads];
|
||||
|
||||
for (int threadCounter = 0; threadCounter < numberOfThreads; threadCounter++)
|
||||
{
|
||||
sqlTasks[threadCounter] = new System.Threading.Thread(() => PerformSqlTask(threadCounter, this));
|
||||
sqlTasks[threadCounter].Start();
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.errorHasOccurred = true;
|
||||
this.errorDetails = ex.ToString();
|
||||
}
|
||||
|
||||
if (this.errorHasOccurred)
|
||||
{
|
||||
var errorForm = new ErrorDetailsForm();
|
||||
errorForm.ErrorMessage = this.errorDetails;
|
||||
errorForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InsertButton.Text = "Stopping";
|
||||
InsertButton.Refresh();
|
||||
this.Refresh();
|
||||
|
||||
DisplayUpdateTimer.Enabled = false;
|
||||
|
||||
if (sqlTasks != null)
|
||||
{
|
||||
foreach (Thread thread in sqlTasks)
|
||||
{
|
||||
thread.Abort();
|
||||
}
|
||||
}
|
||||
|
||||
InsertButton.Text = "&Insert";
|
||||
}
|
||||
}
|
||||
|
||||
public void PerformSqlTask(int TaskNumber, MultithreadedOrderInsertMain ParentForm)
|
||||
{
|
||||
var errorOccurred = false;
|
||||
|
||||
while (!errorOccurred)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var con = new SqlConnection(ConnectionStringTextBox.Text))
|
||||
{
|
||||
var startingTime = DateTime.Now;
|
||||
|
||||
con.Open();
|
||||
|
||||
using (var selectCommand = con.CreateCommand())
|
||||
{
|
||||
var da = new SqlDataAdapter(selectCommand);
|
||||
var rnd = new Random(TaskNumber);
|
||||
|
||||
selectCommand.CommandText = "SELECT TOP(1) PersonID FROM [Application].People WHERE IsEmployee <> 0 ORDER BY NEWID();";
|
||||
var personTable = new DataTable("Person");
|
||||
da.Fill(personTable);
|
||||
|
||||
var salespersonID = (int)(personTable.Rows[0]["PersonID"]);
|
||||
|
||||
selectCommand.CommandText = "SELECT TOP(1) 1 AS OrderReference, c.CustomerID, c.PrimaryContactPersonID AS ContactPersonID, CAST(DATEADD(day, 1, SYSDATETIME()) AS date) AS ExpectedDeliveryDate, CAST(FLOOR(RAND() * 10000) + 1 AS nvarchar(20)) AS CustomerPurchaseOrderNumber, CAST(0 AS bit) AS IsUndersupplyBackordered, N'Auto-generated' AS Comments, c.DeliveryAddressLine1 + N', ' + c.DeliveryAddressLine2 AS DeliveryInstructions FROM Sales.Customers AS c ORDER BY NEWID();";
|
||||
var orderTable = new DataTable("Orders");
|
||||
da.Fill(orderTable);
|
||||
|
||||
selectCommand.CommandText = "SELECT TOP(7) 1 AS OrderReference, si.StockItemID, si.StockItemName AS [Description], FLOOR(RAND() * 10) + 1 AS Quantity FROM Warehouse.StockItems AS si WHERE IsChillerStock = 0 ORDER BY NEWID()";
|
||||
if (rnd.Next(1, 100) < 4)
|
||||
{
|
||||
selectCommand.CommandText += "UNION ALL SELECT TOP(1) 1 AS OrderReference, si.StockItemID, si.StockItemName AS [Description], FLOOR(RAND() * 10) + 1 AS Quantity FROM Warehouse.StockItems AS si WHERE IsChillerStock <> 0 ORDER BY NEWID()";
|
||||
}
|
||||
selectCommand.CommandText += ";";
|
||||
var orderLinesTable = new DataTable("OrderLines");
|
||||
da.Fill(orderLinesTable);
|
||||
|
||||
using (var insertCommand = con.CreateCommand())
|
||||
{
|
||||
insertCommand.CommandType = CommandType.StoredProcedure;
|
||||
insertCommand.CommandText = "Website.InsertCustomerOrders";
|
||||
|
||||
var orderList = new SqlParameter("@Orders", SqlDbType.Structured);
|
||||
orderList.TypeName = "Website.OrderList";
|
||||
orderList.Value = orderTable;
|
||||
insertCommand.Parameters.Add(orderList);
|
||||
|
||||
var orderLineList = new SqlParameter("@OrderLines", SqlDbType.Structured);
|
||||
orderLineList.TypeName = "Website.OrderLineList";
|
||||
orderLineList.Value = orderLinesTable;
|
||||
insertCommand.Parameters.Add(orderLineList);
|
||||
|
||||
var ordersCreatedByPersonID = new SqlParameter("@OrdersCreatedByPersonID", SqlDbType.Int);
|
||||
ordersCreatedByPersonID.Value = salespersonID;
|
||||
insertCommand.Parameters.Add(ordersCreatedByPersonID);
|
||||
|
||||
var salespersonPersonID = new SqlParameter("@SalespersonPersonID", SqlDbType.Int);
|
||||
salespersonPersonID.Value = salespersonID;
|
||||
insertCommand.Parameters.Add(salespersonPersonID);
|
||||
|
||||
insertCommand.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
con.Close();
|
||||
|
||||
ParentForm.UpdateTotals((int) DateTime.Now.Subtract(startingTime).TotalMilliseconds);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorOccurred = true;
|
||||
ParentForm.errorHasOccurred = true;
|
||||
ParentForm.errorDetails = ex.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayUpdateTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (this.totalOrders > 0)
|
||||
{
|
||||
AverageOrderInsertionTimeTextBox.Text = (totalMilliseconds / totalOrders).ToString();
|
||||
AverageOrderInsertionTimeTextBox.Refresh();
|
||||
this.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="DescriptionTextBox.Text" xml:space="preserve">
|
||||
<value>This application is used to provide an intensive order entry workload for the WideWorldImporters database. Ensure that the connection string details are valid. To reset the connection string details, leave the value blank. When inserts are occurring, click the button to stop but allow time for the system to respond and stop. It may take a few seconds to respond, particularly if a larger number of threads is being used.</value>
|
||||
</data>
|
||||
<metadata name="DisplayUpdateTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MultithreadedOrderInsertMain());
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MultithreadedInMemoryTableInsert")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MultithreadedInMemoryTableInsert")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("35325643-119b-40c9-9f95-be22cb062599")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MultithreadedOrderInsert.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MultithreadedOrderInsert.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MultithreadedOrderInsert.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string WWI_ConnectionString {
|
||||
get {
|
||||
return ((string)(this["WWI_ConnectionString"]));
|
||||
}
|
||||
set {
|
||||
this["WWI_ConnectionString"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MultithreadedInMemoryTableInsert.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="WWI_ConnectionString" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultithreadedOrderInsert", "MultithreadedOrderInsert\MultithreadedOrderInsert.csproj", "{35325643-119B-40C9-9F95-BE22CB062599}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,65 @@
|
||||
# Workload Driver for Order Insertion in WideWorldImporters
|
||||
|
||||
This application simulates an order insertion workload for the WideWorldImporters sample database.
|
||||
|
||||
### Contents
|
||||
|
||||
[About this sample](#about-this-sample)<br/>
|
||||
[Before you begin](#before-you-begin)<br/>
|
||||
[Running the sample](#run-this-sample)<br/>
|
||||
[Sample details](#sample-details)<br/>
|
||||
[Disclaimers](#disclaimers)<br/>
|
||||
[Related links](#related-links)<br/>
|
||||
|
||||
|
||||
<a name=about-this-sample></a>
|
||||
|
||||
## About this sample
|
||||
|
||||
<!-- Delete the ones that don't apply -->
|
||||
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
|
||||
1. **Key features:** Core database features
|
||||
1. **Workload:** OLTP
|
||||
1. **Programming Language:** C#
|
||||
1. **Authors:** Greg Low, Jos de Bruijn
|
||||
1. **Update history:** 25 May 2016 - initial revision
|
||||
|
||||
<a name=before-you-begin></a>
|
||||
|
||||
## Before you begin
|
||||
|
||||
To run this sample, you need the following prerequisites.
|
||||
|
||||
**Software prerequisites:**
|
||||
|
||||
<!-- Examples -->
|
||||
1. SQL Server 2016 (or higher) or Azure SQL Database.
|
||||
2. Visual Studio 2015.
|
||||
3. The WideWorldImporters database.
|
||||
|
||||
<a name=run-this-sample></a>
|
||||
|
||||
## Running the sample
|
||||
|
||||
1. Open the solution file MultithreadedOrderInsertWorkload.sln in Visual Studio.
|
||||
|
||||
2. Build the solution.
|
||||
|
||||
3. Run the app.
|
||||
|
||||
## Sample details
|
||||
|
||||
The driver simulates an order insert workload. You can use it to test performance of transaction processing as well as real-time analytics. TBD: ref to analytics queries
|
||||
|
||||
|
||||
<a name=disclaimers></a>
|
||||
|
||||
## Disclaimers
|
||||
The code included in this sample is not intended to be used for production purposes.
|
||||
|
||||
<a name=related-links></a>
|
||||
|
||||
## Related Links
|
||||
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
|
||||
TBD
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25123.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultithreadedInMemoryTableInsert", "MultithreadedInMemoryTableInsert\MultithreadedInMemoryTableInsert.csproj", "{35325643-119B-40C9-9F95-BE22CB062599}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{35325643-119B-40C9-9F95-BE22CB062599}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="MultithreadedInMemoryTableInsert.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<MultithreadedInMemoryTableInsert.Properties.Settings>
|
||||
<setting name="WWI_ConnectionString" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</MultithreadedInMemoryTableInsert.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
partial class ErrorDetailsForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ErrorDetailsForm));
|
||||
this.MainMessageTextBox = new System.Windows.Forms.TextBox();
|
||||
this.DetailedErrorMessageTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.OKButton = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// MainMessageTextBox
|
||||
//
|
||||
this.MainMessageTextBox.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.MainMessageTextBox.Location = new System.Drawing.Point(29, 12);
|
||||
this.MainMessageTextBox.Multiline = true;
|
||||
this.MainMessageTextBox.Name = "MainMessageTextBox";
|
||||
this.MainMessageTextBox.Size = new System.Drawing.Size(942, 55);
|
||||
this.MainMessageTextBox.TabIndex = 1;
|
||||
this.MainMessageTextBox.TabStop = false;
|
||||
this.MainMessageTextBox.Text = resources.GetString("MainMessageTextBox.Text");
|
||||
//
|
||||
// DetailedErrorMessageTextBox
|
||||
//
|
||||
this.DetailedErrorMessageTextBox.BackColor = System.Drawing.Color.LightCyan;
|
||||
this.DetailedErrorMessageTextBox.Location = new System.Drawing.Point(29, 105);
|
||||
this.DetailedErrorMessageTextBox.Multiline = true;
|
||||
this.DetailedErrorMessageTextBox.Name = "DetailedErrorMessageTextBox";
|
||||
this.DetailedErrorMessageTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;
|
||||
this.DetailedErrorMessageTextBox.Size = new System.Drawing.Size(942, 294);
|
||||
this.DetailedErrorMessageTextBox.TabIndex = 2;
|
||||
this.DetailedErrorMessageTextBox.TabStop = false;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(26, 86);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(165, 16);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "Detailed error message:";
|
||||
//
|
||||
// OKButton
|
||||
//
|
||||
this.OKButton.Location = new System.Drawing.Point(446, 417);
|
||||
this.OKButton.Name = "OKButton";
|
||||
this.OKButton.Size = new System.Drawing.Size(125, 37);
|
||||
this.OKButton.TabIndex = 6;
|
||||
this.OKButton.Text = "&OK";
|
||||
this.OKButton.UseVisualStyleBackColor = true;
|
||||
this.OKButton.Click += new System.EventHandler(this.OKButton_Click);
|
||||
//
|
||||
// ErrorDetailsForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1017, 466);
|
||||
this.Controls.Add(this.OKButton);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.DetailedErrorMessageTextBox);
|
||||
this.Controls.Add(this.MainMessageTextBox);
|
||||
this.Font = new System.Drawing.Font("Verdana", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "ErrorDetailsForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Error Details";
|
||||
this.TopMost = true;
|
||||
this.Load += new System.EventHandler(this.ErrorDetailsForm_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox MainMessageTextBox;
|
||||
private System.Windows.Forms.TextBox DetailedErrorMessageTextBox;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Button OKButton;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
public partial class ErrorDetailsForm : Form
|
||||
{
|
||||
public string ErrorMessage;
|
||||
|
||||
public ErrorDetailsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ErrorDetailsForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
DetailedErrorMessageTextBox.Text = this.ErrorMessage;
|
||||
}
|
||||
|
||||
private void OKButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="MainMessageTextBox.Text" xml:space="preserve">
|
||||
<value>This program is meant to be used with a specific in-memory demonstration script or configuration. Please ensure that in-memory tables have been enabled and that both the OnDisk and InMemory schemas have been created along with the InsertVehicleLocation procedures in both schemas.</value>
|
||||
</data>
|
||||
</root>
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{35325643-119B-40C9-9F95-BE22CB062599}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MultithreadedInMemoryTableInsert</RootNamespace>
|
||||
<AssemblyName>MultithreadedInMemoryTableInsert</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ErrorFormMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ErrorFormMain.Designer.cs">
|
||||
<DependentUpon>ErrorFormMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MultithreadedInMemoryTableInsertMain.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="MultithreadedInMemoryTableInsertMain.Designer.cs">
|
||||
<DependentUpon>MultithreadedInMemoryTableInsertMain.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="ErrorFormMain.resx">
|
||||
<DependentUpon>ErrorFormMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MultithreadedInMemoryTableInsertMain.resx">
|
||||
<DependentUpon>MultithreadedInMemoryTableInsertMain.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
+249
@@ -0,0 +1,249 @@
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
partial class MultithreadedInMemoryTableInsertMain
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MultithreadedInMemoryTableInsertMain));
|
||||
this.DescriptionTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.ConnectionStringTextBox = new System.Windows.Forms.TextBox();
|
||||
this.InsertButton = new System.Windows.Forms.Button();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.NumberOfThreadsNumericUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.OnDiskRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.InMemoryRadioButton = new System.Windows.Forms.RadioButton();
|
||||
this.NumberOfRowsPerThreadNumericUpDown = new System.Windows.Forms.NumericUpDown();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.LastExecutionTimeTextBox = new System.Windows.Forms.TextBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NumberOfThreadsNumericUpDown)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NumberOfRowsPerThreadNumericUpDown)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// DescriptionTextBox
|
||||
//
|
||||
this.DescriptionTextBox.BackColor = System.Drawing.SystemColors.Info;
|
||||
this.DescriptionTextBox.Location = new System.Drawing.Point(13, 13);
|
||||
this.DescriptionTextBox.Multiline = true;
|
||||
this.DescriptionTextBox.Name = "DescriptionTextBox";
|
||||
this.DescriptionTextBox.Size = new System.Drawing.Size(1116, 55);
|
||||
this.DescriptionTextBox.TabIndex = 0;
|
||||
this.DescriptionTextBox.TabStop = false;
|
||||
this.DescriptionTextBox.Text = resources.GetString("DescriptionTextBox.Text");
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(13, 91);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(141, 17);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Connection String:";
|
||||
//
|
||||
// ConnectionStringTextBox
|
||||
//
|
||||
this.ConnectionStringTextBox.Location = new System.Drawing.Point(13, 123);
|
||||
this.ConnectionStringTextBox.Name = "ConnectionStringTextBox";
|
||||
this.ConnectionStringTextBox.Size = new System.Drawing.Size(1116, 24);
|
||||
this.ConnectionStringTextBox.TabIndex = 0;
|
||||
//
|
||||
// InsertButton
|
||||
//
|
||||
this.InsertButton.Location = new System.Drawing.Point(609, 251);
|
||||
this.InsertButton.Name = "InsertButton";
|
||||
this.InsertButton.Size = new System.Drawing.Size(125, 37);
|
||||
this.InsertButton.TabIndex = 5;
|
||||
this.InsertButton.Text = "&Insert";
|
||||
this.InsertButton.UseVisualStyleBackColor = true;
|
||||
this.InsertButton.Click += new System.EventHandler(this.InsertButton_Click);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(13, 178);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(150, 17);
|
||||
this.label2.TabIndex = 3;
|
||||
this.label2.Text = "Number of Threads:";
|
||||
//
|
||||
// NumberOfThreadsNumericUpDown
|
||||
//
|
||||
this.NumberOfThreadsNumericUpDown.Location = new System.Drawing.Point(187, 178);
|
||||
this.NumberOfThreadsNumericUpDown.Maximum = new decimal(new int[] {
|
||||
250,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.NumberOfThreadsNumericUpDown.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.NumberOfThreadsNumericUpDown.Name = "NumberOfThreadsNumericUpDown";
|
||||
this.NumberOfThreadsNumericUpDown.Size = new System.Drawing.Size(120, 24);
|
||||
this.NumberOfThreadsNumericUpDown.TabIndex = 1;
|
||||
this.NumberOfThreadsNumericUpDown.Value = new decimal(new int[] {
|
||||
120,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(13, 251);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(155, 17);
|
||||
this.label3.TabIndex = 4;
|
||||
this.label3.Text = "Table Insertion Type:";
|
||||
//
|
||||
// OnDiskRadioButton
|
||||
//
|
||||
this.OnDiskRadioButton.AutoSize = true;
|
||||
this.OnDiskRadioButton.Checked = true;
|
||||
this.OnDiskRadioButton.Location = new System.Drawing.Point(187, 251);
|
||||
this.OnDiskRadioButton.Name = "OnDiskRadioButton";
|
||||
this.OnDiskRadioButton.Size = new System.Drawing.Size(81, 21);
|
||||
this.OnDiskRadioButton.TabIndex = 3;
|
||||
this.OnDiskRadioButton.TabStop = true;
|
||||
this.OnDiskRadioButton.Text = "On Disk";
|
||||
this.OnDiskRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// InMemoryRadioButton
|
||||
//
|
||||
this.InMemoryRadioButton.AutoSize = true;
|
||||
this.InMemoryRadioButton.Location = new System.Drawing.Point(187, 278);
|
||||
this.InMemoryRadioButton.Name = "InMemoryRadioButton";
|
||||
this.InMemoryRadioButton.Size = new System.Drawing.Size(100, 21);
|
||||
this.InMemoryRadioButton.TabIndex = 4;
|
||||
this.InMemoryRadioButton.Text = "In Memory";
|
||||
this.InMemoryRadioButton.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// NumberOfRowsPerThreadNumericUpDown
|
||||
//
|
||||
this.NumberOfRowsPerThreadNumericUpDown.Location = new System.Drawing.Point(614, 180);
|
||||
this.NumberOfRowsPerThreadNumericUpDown.Maximum = new decimal(new int[] {
|
||||
1000000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.NumberOfRowsPerThreadNumericUpDown.Minimum = new decimal(new int[] {
|
||||
100,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.NumberOfRowsPerThreadNumericUpDown.Name = "NumberOfRowsPerThreadNumericUpDown";
|
||||
this.NumberOfRowsPerThreadNumericUpDown.Size = new System.Drawing.Size(120, 24);
|
||||
this.NumberOfRowsPerThreadNumericUpDown.TabIndex = 2;
|
||||
this.NumberOfRowsPerThreadNumericUpDown.Value = new decimal(new int[] {
|
||||
1000,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(378, 180);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(213, 17);
|
||||
this.label4.TabIndex = 8;
|
||||
this.label4.Text = "Number of Rows per Thread:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(779, 180);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(254, 17);
|
||||
this.label5.TabIndex = 9;
|
||||
this.label5.Text = "Last Execution Time (Milliseconds):";
|
||||
//
|
||||
// LastExecutionTimeTextBox
|
||||
//
|
||||
this.LastExecutionTimeTextBox.BackColor = System.Drawing.Color.PeachPuff;
|
||||
this.LastExecutionTimeTextBox.Font = new System.Drawing.Font("Verdana", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.LastExecutionTimeTextBox.Location = new System.Drawing.Point(782, 221);
|
||||
this.LastExecutionTimeTextBox.Name = "LastExecutionTimeTextBox";
|
||||
this.LastExecutionTimeTextBox.Size = new System.Drawing.Size(220, 46);
|
||||
this.LastExecutionTimeTextBox.TabIndex = 10;
|
||||
this.LastExecutionTimeTextBox.TabStop = false;
|
||||
//
|
||||
// MultithreadedInMemoryTableInsertMain
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1150, 345);
|
||||
this.Controls.Add(this.LastExecutionTimeTextBox);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.NumberOfRowsPerThreadNumericUpDown);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.InMemoryRadioButton);
|
||||
this.Controls.Add(this.OnDiskRadioButton);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.NumberOfThreadsNumericUpDown);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.InsertButton);
|
||||
this.Controls.Add(this.ConnectionStringTextBox);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.DescriptionTextBox);
|
||||
this.Font = new System.Drawing.Font("Verdana", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "MultithreadedInMemoryTableInsertMain";
|
||||
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||
this.Text = "Multithreaded In Memory Table Insert Main";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MultithreadedInMemoryTableInsertMain_FormClosing);
|
||||
this.Load += new System.EventHandler(this.MultithreadedInMemoryTableInsertMain_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.NumberOfThreadsNumericUpDown)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.NumberOfRowsPerThreadNumericUpDown)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox DescriptionTextBox;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.TextBox ConnectionStringTextBox;
|
||||
private System.Windows.Forms.Button InsertButton;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.NumericUpDown NumberOfThreadsNumericUpDown;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.RadioButton OnDiskRadioButton;
|
||||
private System.Windows.Forms.RadioButton InMemoryRadioButton;
|
||||
private System.Windows.Forms.NumericUpDown NumberOfRowsPerThreadNumericUpDown;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.TextBox LastExecutionTimeTextBox;
|
||||
}
|
||||
}
|
||||
|
||||
+154
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
public partial class MultithreadedInMemoryTableInsertMain : Form
|
||||
{
|
||||
public bool errorHasOccurred;
|
||||
public string errorDetails;
|
||||
|
||||
public MultithreadedInMemoryTableInsertMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void MultithreadedInMemoryTableInsertMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
ConnectionStringTextBox.Text = Properties.Settings.Default.WWI_ConnectionString;
|
||||
if (ConnectionStringTextBox.Text.Length == 0)
|
||||
{
|
||||
ConnectionStringTextBox.Text = "Server=.;Database=WideWorldImporters;Integrated Security=true;Column Encryption Setting=disabled;Max Pool Size=250;";
|
||||
}
|
||||
}
|
||||
|
||||
private void MultithreadedInMemoryTableInsertMain_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.WWI_ConnectionString = ConnectionStringTextBox.Text;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
|
||||
private void InsertButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
InsertButton.Text = "Running";
|
||||
InsertButton.Refresh();
|
||||
|
||||
this.errorHasOccurred = false;
|
||||
this.errorDetails = "";
|
||||
|
||||
if (ConnectionStringTextBox.Text.Length == 0)
|
||||
{
|
||||
ConnectionStringTextBox.Text = "Server=.;Database=WideWorldImporters;Integrated Security=true;Column Encryption Setting=disabled;Max Pool Size=250;";
|
||||
}
|
||||
|
||||
if (!ConnectionStringTextBox.Text.ToUpper().Contains("MAX POOL SIZE"))
|
||||
{
|
||||
ConnectionStringTextBox.Text = (ConnectionStringTextBox.Text + ";Max Pool Size=250;").Replace(";;", ";");
|
||||
}
|
||||
|
||||
var startingTime = DateTime.Now;
|
||||
|
||||
try
|
||||
{
|
||||
int numberOfThreads = (int)NumberOfThreadsNumericUpDown.Value;
|
||||
|
||||
var sqlTasks = new Thread[numberOfThreads];
|
||||
|
||||
for (int threadCounter = 0; threadCounter < numberOfThreads; threadCounter++)
|
||||
{
|
||||
sqlTasks[threadCounter] = new System.Threading.Thread(() => PerformSqlTask(threadCounter, this));
|
||||
sqlTasks[threadCounter].Start();
|
||||
}
|
||||
|
||||
if (sqlTasks != null)
|
||||
{
|
||||
foreach (Thread thread in sqlTasks)
|
||||
{
|
||||
thread.Join();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.errorHasOccurred = true;
|
||||
this.errorDetails = ex.ToString();
|
||||
}
|
||||
|
||||
InsertButton.Text = "&Insert";
|
||||
LastExecutionTimeTextBox.Text = ((int)DateTime.Now.Subtract(startingTime).TotalMilliseconds).ToString();
|
||||
|
||||
if (this.errorHasOccurred)
|
||||
{
|
||||
var errorForm = new ErrorDetailsForm();
|
||||
errorForm.ErrorMessage = this.errorDetails;
|
||||
errorForm.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
public void PerformSqlTask(int TaskNumber, MultithreadedInMemoryTableInsertMain ParentForm)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (var con = new SqlConnection(ConnectionStringTextBox.Text))
|
||||
{
|
||||
con.Open();
|
||||
|
||||
using (var cmd = con.CreateCommand())
|
||||
{
|
||||
if (OnDiskRadioButton.Checked)
|
||||
{
|
||||
cmd.CommandText = "EXEC OnDisk.InsertVehicleLocation @RegistrationNumber, @TrackedWhen, @Longitude, @Latitude;";
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd.CommandText = "EXEC InMemory.InsertVehicleLocation @RegistrationNumber, @TrackedWhen, @Longitude, @Latitude;";
|
||||
}
|
||||
cmd.Parameters.Add(new SqlParameter("@RegistrationNumber", SqlDbType.NVarChar, 20));
|
||||
cmd.Parameters.Add(new SqlParameter("@TrackedWhen", SqlDbType.DateTime2));
|
||||
var p = new SqlParameter("@Longitude", SqlDbType.Decimal);
|
||||
p.Precision = 18;
|
||||
p.Scale = 4;
|
||||
cmd.Parameters.Add(p);
|
||||
p = new SqlParameter("@Latitude", SqlDbType.Decimal);
|
||||
p.Precision = 18;
|
||||
p.Scale = 4;
|
||||
cmd.Parameters.Add(p);
|
||||
|
||||
var rnd = new Random();
|
||||
|
||||
var tran = con.BeginTransaction();
|
||||
cmd.Transaction = tran;
|
||||
|
||||
for (int counter = 0; counter < NumberOfRowsPerThreadNumericUpDown.Value; counter++)
|
||||
{
|
||||
cmd.Parameters["@RegistrationNumber"].Value = "EA24-GL";
|
||||
cmd.Parameters["@TrackedWhen"].Value = DateTime.Now;
|
||||
cmd.Parameters["@Longitude"].Value = rnd.Next(100);
|
||||
cmd.Parameters["@Latitude"].Value = rnd.Next(100);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
tran.Commit();
|
||||
}
|
||||
con.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ParentForm.errorHasOccurred = true;
|
||||
ParentForm.errorDetails = ex.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="DescriptionTextBox.Text" xml:space="preserve">
|
||||
<value>This application is used to compare the insertion of rows into the OnDisk and InMemory tables in Wide World Importers. Ensure that the connection string details are valid. (To reset the connection string details, leave the value blank).</value>
|
||||
</data>
|
||||
</root>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MultithreadedInMemoryTableInsertMain());
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("MultithreadedInMemoryTableInsert")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MultithreadedInMemoryTableInsert")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("35325643-119b-40c9-9f95-be22cb062599")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MultithreadedInMemoryTableInsert.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace MultithreadedInMemoryTableInsert.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||
public string WWI_ConnectionString {
|
||||
get {
|
||||
return ((string)(this["WWI_ConnectionString"]));
|
||||
}
|
||||
set {
|
||||
this["WWI_ConnectionString"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MultithreadedInMemoryTableInsert.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="WWI_ConnectionString" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
# Workload Driver for Vehicle Location Insertion in WideWorldImporters
|
||||
|
||||
This application simulates an insertion workload for vehicle location in the WideWorldImporters sample database.
|
||||
|
||||
The main purpose is to compare the performance of data insertion into traditional disk-based tables compared with memory-optimized tables. For a more comprehensive sample demonstrating the performance of In-Memory OLTP see the [in-memory/ticket-reservations](/samples/features/in-memory/ticket-reservations) sample.
|
||||
|
||||
### Contents
|
||||
|
||||
[About this sample](#about-this-sample)<br/>
|
||||
[Before you begin](#before-you-begin)<br/>
|
||||
[Running the sample](#run-this-sample)<br/>
|
||||
[Sample details](#sample-details)<br/>
|
||||
[Disclaimers](#disclaimers)<br/>
|
||||
[Related links](#related-links)<br/>
|
||||
|
||||
|
||||
<a name=about-this-sample></a>
|
||||
|
||||
## About this sample
|
||||
|
||||
<!-- Delete the ones that don't apply -->
|
||||
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
|
||||
1. **Key features:** Core database features
|
||||
1. **Workload:** OLTP
|
||||
1. **Programming Language:** C#
|
||||
1. **Authors:** Greg Low, Jos de Bruijn
|
||||
1. **Update history:** 25 May 2016 - initial revision
|
||||
|
||||
<a name=before-you-begin></a>
|
||||
|
||||
## Before you begin
|
||||
|
||||
To run this sample, you need the following prerequisites.
|
||||
|
||||
**Software prerequisites:**
|
||||
|
||||
<!-- Examples -->
|
||||
1. SQL Server 2016 (or higher) or Azure SQL Database.
|
||||
2. Visual Studio 2015.
|
||||
3. The WideWorldImporters database.
|
||||
|
||||
<a name=run-this-sample></a>
|
||||
|
||||
## Running the sample
|
||||
|
||||
1. Open the solution file MultithreadedInMemoryTableInsert.sln in Visual Studio.
|
||||
|
||||
2. Build the solution.
|
||||
|
||||
3. Run the app.
|
||||
|
||||
## Sample details
|
||||
|
||||
The driver simulates an insert workload for vehicle location obtained from sensors in the vehicles of Wide World Importers. You can use it to constrast the performance of disk-based with memory-optimized tables on your system.
|
||||
|
||||
TBD: more guidelines on perf
|
||||
|
||||
|
||||
<a name=disclaimers></a>
|
||||
|
||||
## Disclaimers
|
||||
The code included in this sample is not intended to be used for production purposes.
|
||||
|
||||
<a name=related-links></a>
|
||||
|
||||
## Related Links
|
||||
<!-- Links to more articles. Remember to delete "en-us" from the link path. -->
|
||||
TBD
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
-- Configure required database objects
|
||||
-- Version 1.3 Dr Greg Low 21 May 2016
|
||||
--
|
||||
|
||||
USE WideWorldImporters;
|
||||
|
||||
@@ -16,7 +16,7 @@ The scripts in this folder are used to construct the WideWorldImporters database
|
||||
## About this sample
|
||||
|
||||
<!-- Delete the ones that don't apply -->
|
||||
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
|
||||
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database [testing and modified instructions are TBD]
|
||||
1. **Key features:** Core database features
|
||||
1. **Workload:** OLTP
|
||||
1. **Programming Language:** T-SQL
|
||||
|
||||
+3
-6
@@ -4,12 +4,9 @@ USE WWI_DW_Preparation;
|
||||
GO
|
||||
|
||||
-- Configuration
|
||||
DECLARE @SQLDataFolder nvarchar(max) = (SELECT SUBSTRING(mf.physical_name, 1, CHARINDEX(N'master.mdf', mf.physical_name, 1) - 1)
|
||||
FROM master.sys.master_files AS mf
|
||||
WHERE mf.database_id = 1 AND mf.file_id = 1);
|
||||
DECLARE @SQLLogFolder nvarchar(max) = (SELECT SUBSTRING(mf.physical_name, 1, CHARINDEX(N'mastlog.ldf', mf.physical_name, 1) - 1)
|
||||
FROM master.sys.master_files AS mf
|
||||
WHERE mf.database_id = 1 AND mf.file_id = 2);
|
||||
DECLARE @SQLDataFolder nvarchar(max) = CAST(SERVERPROPERTY('InstanceDefaultDataPath') AS nvarchar(max));
|
||||
DECLARE @SQLLogFolder nvarchar(max) = CAST(SERVERPROPERTY('InstanceDefaultLogPath') AS nvarchar(max));
|
||||
|
||||
|
||||
DECLARE @LastEditedByColumnName sysname = N'LastEditedBy';
|
||||
DECLARE @LastEditedWhenColumnName sysname = N'LastEditedWhen';
|
||||
|
||||
@@ -16,7 +16,7 @@ The scripts in this folder are used to construct the WideWorldImportersDW databa
|
||||
## About this sample
|
||||
|
||||
<!-- Delete the ones that don't apply -->
|
||||
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database
|
||||
1. **Applies to:** SQL Server 2016 (or higher), Azure SQL Database [testing and modified instructions are TBD]
|
||||
1. **Key features:** Core database features
|
||||
1. **Workload:** OLTP
|
||||
1. **Programming Language:** T-SQL
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user