EasyToMySql 1.0.1
dotnet add package EasyToMySql --version 1.0.1
NuGet\Install-Package EasyToMySql -Version 1.0.1
<PackageReference Include="EasyToMySql" Version="1.0.1"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add EasyToMySql --version 1.0.1
#r "nuget: EasyToMySql, 1.0.1"
// Install EasyToMySql as a Cake Addin #addin nuget:?package=EasyToMySql&version=1.0.1 // Install EasyToMySql as a Cake Tool #tool nuget:?package=EasyToMySql&version=1.0.1
To use this library you should add this namespace at the top of your code:
using EasyToMySql;
There are three functions to get value from the database or make a change on it, also there is no Constructor
for running on instantiation.
At first, you should call the Open()
method and give it the required parameters to make your connection open. It is really simple, you need to give it your Hostname, Database name, Username, Password, Charset and the connection encryption status with a boolean type that is defined False
for running local projects without any bug.
This method will generate the ConnectionString
for you based on the given parameters, also it will open a connection to the target database and close it for test reasons; If you want to know the result of this function, you can print the output of the method like this:
Connect oConnect = new Connect();
- Making an instance
oConnect.Open( Hostname , Database , UTF8 , Username , Password , false);
-This method will generate the ConnectionString
based on the given values.
Console.WireLine(oConnect.Open(Hostname , Database , UTF8 , Username , Password , false));
- Output: "Connection established successfully."
Now you can execute your own queries, use the properties that generated by methods, pass the values to MySql
library as this package depends on it and because of this library is created based on OpenSource concepts & values, there is no Sealed
class to let you develop it locally based on your usage.
Also, there were 2 other methods for the first release of it.
The first one is the Inserter
function, with the Inserter
you can add Values
to the preferred Fields
of your target Table
.
It is easier than the upper method and it should be used to insert values into the database.
Example code is just like this:
oConnect.Inserter( Example Table, "user_Id, user_Name" , "NULL, Milad" );
-Remember the ConnectionString
generated in the previous method and you need to give the requested values to let this function work correctly.
The second one is Deleter
method. Deleter
accepts three parameters as its arguments, those are the table name that can be given from the Table
property of the library and the target Field
with its Integral Id
to remove it after the query execution.
Example code is just like this:
oConnect.Deleter( Example Table, user_Id , 1);
-You can also give Table
property of library instead of writing its name repeatedly.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.5
- MySql.Data (>= 6.9.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.1 | 1,062 | 2/9/2018 |
First release.