Skip to content

Commit 03bbfaf

Browse files
committed
Finished Insert, Update, and delete with their examples
1 parent 4237652 commit 03bbfaf

File tree

393 files changed

+35577
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+35577
-11
lines changed
72.5 KB
Binary file not shown.
Binary file not shown.

Examples/Delete/Delete/Delete.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Delete", "Delete\Delete.csproj", "{F5EF7D7D-539E-4223-8015-D665C49A059C}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{F5EF7D7D-539E-4223-8015-D665C49A059C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{F5EF7D7D-539E-4223-8015-D665C49A059C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{F5EF7D7D-539E-4223-8015-D665C49A059C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{F5EF7D7D-539E-4223-8015-D665C49A059C}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {53274625-0BEA-459B-9763-8736D3BF6D72}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
5+
</startup>
6+
</configuration>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{F5EF7D7D-539E-4223-8015-D665C49A059C}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>Delete</RootNamespace>
10+
<AssemblyName>Delete</AssemblyName>
11+
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<PlatformTarget>AnyCPU</PlatformTarget>
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<PlatformTarget>AnyCPU</PlatformTarget>
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>true</Optimize>
29+
<OutputPath>bin\Release\</OutputPath>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<ErrorReport>prompt</ErrorReport>
32+
<WarningLevel>4</WarningLevel>
33+
</PropertyGroup>
34+
<ItemGroup>
35+
<Reference Include="MySQLManager">
36+
<HintPath>..\..\..\..\src\MySQLManager\MySQLManager\bin\Debug\netstandard2.0\MySQLManager.dll</HintPath>
37+
</Reference>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Net.Http" />
45+
<Reference Include="System.Xml" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<Compile Include="Program.cs" />
49+
<Compile Include="Properties\AssemblyInfo.cs" />
50+
</ItemGroup>
51+
<ItemGroup>
52+
<None Include="App.config" />
53+
</ItemGroup>
54+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
55+
</Project>
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using MySQLManager;
7+
using MySQLManager.Enums;
8+
using MySQLManager.EventArguments;
9+
using MySQLManager.Helpers;
10+
11+
namespace Delete
12+
{
13+
class Program
14+
{
15+
static void Main(string[] args)
16+
{
17+
ConnectionCredentials credentials = new ConnectionCredentials
18+
{
19+
Server = "127.0.0.1",
20+
Database = "mysqlmanager",
21+
Username = "root",
22+
Password = ""
23+
};
24+
25+
CRUDManager manager = new CRUDManager(credentials);
26+
27+
manager.ConnectionOpenedSuccessfully += Manager_ConnectionOpenedSuccessfully;
28+
manager.ConnectionFailedToOpen += Manager_ConnectionFailedToOpen;
29+
manager.ConnectionClosedSuccessfully += Manager_ConnectionClosedSuccessfully;
30+
manager.ConnectionFailedToClose += Manager_ConnectionFailedToClose;
31+
manager.DeletedSuccessfully += Manager_DeletedSuccessfully;
32+
manager.FailedToDelete += Manager_FailedToDelete;
33+
34+
Console.WriteLine("Condition Field: ");
35+
string condName = Console.ReadLine();
36+
37+
Console.WriteLine("Condition Value: ");
38+
string condVal = Console.ReadLine();
39+
40+
Field[] condition =
41+
{
42+
new Field(condName,condVal)
43+
};
44+
45+
manager.Delete("info", condition);
46+
47+
Console.WriteLine("Pres any key to continue...");
48+
Console.ReadKey();
49+
}
50+
51+
private static void Manager_FailedToDelete(object sender, FailedToDeleteEventArgs e)
52+
{
53+
Console.WriteLine(e.ErrorMessage);
54+
}
55+
56+
private static void Manager_DeletedSuccessfully(object sender, EventArgs e)
57+
{
58+
Console.WriteLine("Row is deleted successfully");
59+
}
60+
61+
private static void Manager_ConnectionFailedToClose(object sender, ConnectionFailedToCloseEventArgs e)
62+
{
63+
Console.WriteLine(e.ErrorMessage);
64+
}
65+
66+
private static void Manager_ConnectionClosedSuccessfully(object sender, EventArgs e)
67+
{
68+
Console.WriteLine("Connection closed successfully");
69+
}
70+
71+
private static void Manager_ConnectionFailedToOpen(object sender, ConnectionFailedToOpenEventArgs e)
72+
{
73+
Console.WriteLine(e.ErrorMessage);
74+
}
75+
76+
private static void Manager_ConnectionOpenedSuccessfully(object sender, EventArgs e)
77+
{
78+
Console.WriteLine("Connection was opened successfully");
79+
}
80+
}
81+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
// General Information about an assembly is controlled through the following
6+
// set of attributes. Change these attribute values to modify the information
7+
// associated with an assembly.
8+
[assembly: AssemblyTitle("Delete")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("Delete")]
13+
[assembly: AssemblyCopyright("Copyright © 2017")]
14+
[assembly: AssemblyTrademark("")]
15+
[assembly: AssemblyCulture("")]
16+
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
19+
// COM, set the ComVisible attribute to true on that type.
20+
[assembly: ComVisible(false)]
21+
22+
// The following GUID is for the ID of the typelib if this project is exposed to COM
23+
[assembly: Guid("f5ef7d7d-539e-4223-8015-d665c49a059c")]
24+
25+
// Version information for an assembly consists of the following four values:
26+
//
27+
// Major Version
28+
// Minor Version
29+
// Build Number
30+
// Revision
31+
//
32+
// You can specify all the values or you can default the Build and Revision Numbers
33+
// by using the '*' as shown below:
34+
// [assembly: AssemblyVersion("1.0.*")]
35+
[assembly: AssemblyVersion("1.0.0.0")]
36+
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.

0 commit comments

Comments
 (0)