to support this project!
Readme (via GitHub)
WrapSQL
Multiple wrapper-classes for several languages and DB-Types
Supported Languages and DB-Types
- .Net (C#, F#, VB.Net)
- MySQL
- SQLite
- ODBC
- OleDb
- PHP
- MySQL
How to get the right version for your project
.Net:
Download the latest version of WrapSQL as a nuget-package from nuget.org or GitHub Packages.
-
WrapMySQL:
- via command-line:
Install-Package Endev.WrapSQL.WrapMySQL
- Download on nuget.org
- via command-line:
-
WrapSQLite:
- via command-line:
Install-Package Endev.WrapSQL.WrapSQLite
- Download on nuget.org
- via command-line:
-
WrapODBC:
- via command-line:
Install-Package Endev.WrapSQL.WrapODBC
- Download on nuget.org
- via command-line:
-
WrapOleDB:
- via command-line:
Install-Package Endev.WrapSQL.WrapOleDB
- Download on nuget.org
- via command-line:
PHP:
Get the latest version from the releases page
Documentation
- README - C#
- README - F# (TBA)
- README - VB.NET
- README - PHP
Quick overview
The following methods/function exists for every port of WrapSQL in every language. Check corresponding readme for additional features.
// Creating a WrapSQL-Object (e.g. WrapMySQL)
using(WrapMySQL sql = new WrapMySQL("--- MySQL Connection String ---"))
{
// Executes a non-query statement, e.g. UPDATE, INSERT, DELETE, ...
sql.ExecuteNonQuery("UPDATE customers SET Firstname = ? WHERE ID = ?", firstName, customerID);
// Returns a single value from a select-statement
int completedOrderCount = sql.ExecuteScalar<int>("SELECT COUNT(*) FROM orders WHERE completed = ?", true);
// Returns all effected rows retrieved by the select-statement
using (MySQLDataReader reader = (MySQLDataReader)sql.ExecuteQuery("SELECT * FROM orders"))
{
while (reader.Read())
{
Console.WriteLine(reader["orderStatus"]);
}
}
}