Skip to content

Commit 7d29438

Browse files
committed
MySQL Database Library
1 parent 4ca0873 commit 7d29438

14 files changed

+206
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
8+
9+
namespace MySQL_Database_Library
10+
{
11+
public class Library_Properties
12+
13+
{
14+
15+
16+
17+
private string sql_string;
18+
private string strCon;
19+
20+
21+
// This write-only property collects the User's SQL string command
22+
23+
public string Sql
24+
{
25+
26+
set { sql_string = value; }
27+
28+
}
29+
30+
// This write-only property collects the database file_path from the User
31+
32+
public string connection_string
33+
{
34+
35+
set { strCon = value; }
36+
37+
}
38+
39+
/* This read-only property returns MyDataSet method that performs connection to the database
40+
*
41+
* and also the DataSet object holding pulled records from the database to the User
42+
*/
43+
44+
public System.Data.DataSet GetConnection
45+
46+
{
47+
48+
get { return MyDataSet(); }
49+
50+
}
51+
52+
53+
54+
System.Data.DataSet dat_set;
55+
System.Data.SqlServerCe.SqlCeDataAdapter da_1;
56+
57+
58+
/* This method perform connection to the database
59+
*
60+
* and pull records from the database into a DataSet object
61+
*/
62+
63+
private System.Data.DataSet MyDataSet()
64+
65+
{
66+
67+
System.Data.SqlServerCe.SqlCeConnection con = new System.Data.SqlServerCe.SqlCeConnection(strCon);
68+
69+
con.Open();
70+
71+
da_1 = new System.Data.SqlServerCe.SqlCeDataAdapter(sql_string,con);
72+
73+
dat_set = new System.Data.DataSet();
74+
da_1.Fill(dat_set, "Default Table");
75+
76+
con.Close();
77+
78+
return dat_set;
79+
80+
}
81+
82+
83+
// This method updates the database
84+
85+
public void UpdateDB()
86+
87+
{
88+
89+
System.Data.SqlServerCe.SqlCeCommandBuilder cb;
90+
cb = new System.Data.SqlServerCe.SqlCeCommandBuilder(da_1);
91+
cb.DataAdapter.Update(dat_set.Tables["Default Table"]);
92+
93+
}
94+
95+
96+
97+
98+
}
99+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>{B9D41D7F-15F2-42FA-98E7-DC8ED4D65749}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>MySQL_Database_Library</RootNamespace>
11+
<AssemblyName>MySQL_Database_Library</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
36+
<SpecificVersion>False</SpecificVersion>
37+
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Desktop\System.Data.SqlServerCe.dll</HintPath>
38+
</Reference>
39+
<Reference Include="System.Deployment" />
40+
<Reference Include="System.Drawing" />
41+
<Reference Include="System.Windows.Forms" />
42+
<Reference Include="System.Xml.Linq" />
43+
<Reference Include="System.Data.DataSetExtensions" />
44+
<Reference Include="Microsoft.CSharp" />
45+
<Reference Include="System.Data" />
46+
<Reference Include="System.Xml" />
47+
</ItemGroup>
48+
<ItemGroup>
49+
<Compile Include="Library_Properties.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
</ItemGroup>
52+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
54+
Other similar extension points exist, see Microsoft.Common.targets.
55+
<Target Name="BeforeBuild">
56+
</Target>
57+
<Target Name="AfterBuild">
58+
</Target>
59+
-->
60+
</Project>
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+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ProjectView>ShowAllFiles</ProjectView>
5+
</PropertyGroup>
6+
</Project>
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("MySQL_Database_Library")]
9+
[assembly: AssemblyDescription("")]
10+
[assembly: AssemblyConfiguration("")]
11+
[assembly: AssemblyCompany("")]
12+
[assembly: AssemblyProduct("MySQL_Database_Library")]
13+
[assembly: AssemblyCopyright("Copyright © 2018")]
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("9a1c762a-d467-4082-8334-50c4e195879c")]
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.
Binary file not shown.
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
C:\Users\Franklin Ezeji\documents\visual studio 2012\Projects\MySQL_Database_Library\MySQL_Database_Library\obj\Debug\MySQL_Database_Library.csprojResolveAssemblyReference.cache
2+
C:\Users\Franklin Ezeji\documents\visual studio 2012\Projects\MySQL_Database_Library\MySQL_Database_Library\bin\Debug\MySQL_Database_Library.dll
3+
C:\Users\Franklin Ezeji\documents\visual studio 2012\Projects\MySQL_Database_Library\MySQL_Database_Library\bin\Debug\MySQL_Database_Library.pdb
4+
C:\Users\Franklin Ezeji\documents\visual studio 2012\Projects\MySQL_Database_Library\MySQL_Database_Library\obj\Debug\MySQL_Database_Library.dll
5+
C:\Users\Franklin Ezeji\documents\visual studio 2012\Projects\MySQL_Database_Library\MySQL_Database_Library\obj\Debug\MySQL_Database_Library.pdb
Binary file not shown.
Binary file not shown.

MySQL_Database_Library/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

Whitespace-only changes.

MySQL_Database_Library/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

Whitespace-only changes.

MySQL_Database_Library/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

Whitespace-only changes.

0 commit comments

Comments
 (0)