Skip to content

Commit 9c71fde

Browse files
author
Kevin Bernau
committed
Fixed DataReader not being closed
Cleaned up solution Updated nuget packages [Untested] Used Get functions instead of casting the types
1 parent 424091b commit 9c71fde

File tree

8 files changed

+220
-100
lines changed

8 files changed

+220
-100
lines changed

MySQL-To-CSharp/App.config

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,54 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<startup>
3+
<startup>
44
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
55
</startup>
6-
<system.data>
7-
<DbProviderFactories>
8-
<remove invariant="MySql.Data.MySqlClient" />
9-
<add description=".Net Framework Data Provider for MySQL" invariant="MySql.Data.MySqlClient" name="MySQL Data Provider" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.10.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
10-
</DbProviderFactories>
11-
</system.data></configuration>
6+
7+
<runtime>
8+
9+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
10+
11+
<dependentAssembly>
12+
13+
<assemblyIdentity name="BouncyCastle.Crypto" publicKeyToken="0e99375e54769942" culture="neutral" />
14+
15+
<bindingRedirect oldVersion="0.0.0.0-1.8.9.0" newVersion="1.8.9.0" />
16+
17+
</dependentAssembly>
18+
19+
<dependentAssembly>
20+
21+
<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
22+
23+
<bindingRedirect oldVersion="0.0.0.0-3.20.0.0" newVersion="3.20.0.0" />
24+
25+
</dependentAssembly>
26+
27+
<dependentAssembly>
28+
29+
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
30+
31+
<bindingRedirect oldVersion="0.0.0.0-1.2.16.0" newVersion="1.2.16.0" />
32+
33+
</dependentAssembly>
34+
35+
<dependentAssembly>
36+
37+
<assemblyIdentity name="K4os.Hash.xxHash" publicKeyToken="32cd54395057cec3" culture="neutral" />
38+
39+
<bindingRedirect oldVersion="0.0.0.0-1.0.7.0" newVersion="1.0.7.0" />
40+
41+
</dependentAssembly>
42+
43+
<dependentAssembly>
44+
45+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
46+
47+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
48+
49+
</dependentAssembly>
50+
51+
</assemblyBinding>
52+
53+
</runtime>
54+
</configuration>

MySQL-To-CSharp/ApplicationArguments.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ public class ApplicationArguments
1212
public bool GenerateMarkupPages { get; set; }
1313
public string MarkupDatabaseNameReplacement { get; set; }
1414
}
15-
}
15+
}

MySQL-To-CSharp/Column.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ namespace MySQL_To_CSharp
55
{
66
public class Column
77
{
8-
public string Name { get; set; }
9-
public Type Type { get; set; }
10-
public string ColumnType { get; set; }
11-
128
public Column(MySqlDataReader reader)
139
{
1410
Name = reader.GetString(1);
1511
ColumnType = reader.GetString(2);
1612
}
1713

14+
public string Name { get; set; }
15+
public Type Type { get; set; }
16+
public string ColumnType { get; set; }
17+
1818
public override string ToString()
1919
{
2020
return $"public {Type.Name} {Name.FirstCharUpper()} {{ get; set; }}";
2121
}
2222
}
23-
}
23+
}
Lines changed: 112 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,115 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<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>{8673C77C-EACF-4140-8357-1A2BEA96ED8E}</ProjectGuid>
8-
<OutputType>Exe</OutputType>
9-
<RootNamespace>MySQL_To_CSharp</RootNamespace>
10-
<AssemblyName>MySQL-To-CSharp</AssemblyName>
11-
<TargetFrameworkVersion>v4.6.1</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="FluentCommandLineParser, Version=1.4.3.0, Culture=neutral, processorArchitecture=MSIL">
36-
<HintPath>..\packages\FluentCommandLineParser.1.4.3\lib\net35\FluentCommandLineParser.dll</HintPath>
37-
</Reference>
38-
<Reference Include="MySql.Data, Version=6.10.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
39-
<HintPath>..\packages\MySql.Data.6.10.4\lib\net452\MySql.Data.dll</HintPath>
40-
</Reference>
41-
<Reference Include="System" />
42-
<Reference Include="System.Core" />
43-
<Reference Include="System.Xml.Linq" />
44-
<Reference Include="System.Data.DataSetExtensions" />
45-
<Reference Include="Microsoft.CSharp" />
46-
<Reference Include="System.Data" />
47-
<Reference Include="System.Net.Http" />
48-
<Reference Include="System.Xml" />
49-
</ItemGroup>
50-
<ItemGroup>
51-
<Compile Include="ApplicationArguments.cs" />
52-
<Compile Include="Column.cs" />
53-
<Compile Include="Program.cs" />
54-
<Compile Include="Properties\AssemblyInfo.cs" />
55-
<Compile Include="StringExtensions.cs" />
56-
</ItemGroup>
57-
<ItemGroup>
58-
<None Include="App.config" />
59-
<None Include="packages.config" />
60-
</ItemGroup>
61-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
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>{8673C77C-EACF-4140-8357-1A2BEA96ED8E}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>MySQL_To_CSharp</RootNamespace>
10+
<AssemblyName>MySQL-To-CSharp</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</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="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
36+
<HintPath>..\packages\BouncyCastle.1.8.9\lib\BouncyCastle.Crypto.dll</HintPath>
37+
<Private>True</Private>
38+
</Reference>
39+
<Reference Include="FluentCommandLineParser, Version=1.4.3.0, Culture=neutral, processorArchitecture=MSIL">
40+
<HintPath>..\packages\FluentCommandLineParser.1.4.3\lib\net35\FluentCommandLineParser.dll</HintPath>
41+
</Reference>
42+
<Reference Include="Google.Protobuf, Version=3.20.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604">
43+
<HintPath>..\packages\Google.Protobuf.3.20.0-rc2\lib\net45\Google.Protobuf.dll</HintPath>
44+
<Private>True</Private>
45+
</Reference>
46+
<Reference Include="K4os.Compression.LZ4, Version=1.2.16.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d">
47+
<HintPath>..\packages\K4os.Compression.LZ4.1.2.16\lib\net46\K4os.Compression.LZ4.dll</HintPath>
48+
<Private>True</Private>
49+
</Reference>
50+
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.16.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d">
51+
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.16\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
52+
<Private>True</Private>
53+
</Reference>
54+
<Reference Include="K4os.Hash.xxHash, Version=1.0.7.0, Culture=neutral, PublicKeyToken=32cd54395057cec3">
55+
<HintPath>..\packages\K4os.Hash.xxHash.1.0.7\lib\net46\K4os.Hash.xxHash.dll</HintPath>
56+
<Private>True</Private>
57+
</Reference>
58+
<Reference Include="mscorlib" />
59+
<Reference Include="MySql.Data, Version=8.0.28.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
60+
<HintPath>..\packages\MySql.Data.8.0.28\lib\net452\MySql.Data.dll</HintPath>
61+
<Private>True</Private>
62+
</Reference>
63+
<Reference Include="System" />
64+
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
65+
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
66+
<Private>True</Private>
67+
</Reference>
68+
<Reference Include="System.ComponentModel" />
69+
<Reference Include="System.ComponentModel.DataAnnotations" />
70+
<Reference Include="System.Configuration" />
71+
<Reference Include="System.Configuration.Install" />
72+
<Reference Include="System.Core" />
73+
<Reference Include="System.Management" />
74+
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
75+
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
76+
<Private>True</Private>
77+
</Reference>
78+
<Reference Include="System.Numerics" />
79+
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
80+
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
81+
<Private>True</Private>
82+
</Reference>
83+
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
84+
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
85+
<Private>True</Private>
86+
</Reference>
87+
<Reference Include="System.Transactions" />
88+
<Reference Include="System.Xml.Linq" />
89+
<Reference Include="System.Data.DataSetExtensions" />
90+
<Reference Include="Microsoft.CSharp" />
91+
<Reference Include="System.Data" />
92+
<Reference Include="System.Net.Http" />
93+
<Reference Include="System.Xml" />
94+
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
95+
<HintPath>..\packages\MySql.Data.8.0.28\lib\net452\Ubiety.Dns.Core.dll</HintPath>
96+
<Private>True</Private>
97+
</Reference>
98+
<Reference Include="ZstdNet, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
99+
<HintPath>..\packages\MySql.Data.8.0.28\lib\net452\ZstdNet.dll</HintPath>
100+
<Private>True</Private>
101+
</Reference>
102+
</ItemGroup>
103+
<ItemGroup>
104+
<Compile Include="ApplicationArguments.cs" />
105+
<Compile Include="Column.cs" />
106+
<Compile Include="Program.cs" />
107+
<Compile Include="Properties\AssemblyInfo.cs" />
108+
<Compile Include="StringExtensions.cs" />
109+
</ItemGroup>
110+
<ItemGroup>
111+
<None Include="App.config" />
112+
<None Include="packages.config" />
113+
</ItemGroup>
114+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
62115
</Project>

0 commit comments

Comments
 (0)