Start on QueryBuilder

Created:

- MySql Type Name Map
- Added String Extensions
This commit is contained in:
2021-08-01 08:49:47 +10:00
parent 6cf59c41cc
commit 72f1ccefca
6 changed files with 288 additions and 11 deletions

View File

@ -12,7 +12,7 @@ namespace Articulate
public string UserName { get; set; }
public string Password { get; set; }
private MySqlConnection Connection { get; set; }
public MySqlConnection Connection { get; set; }
private static DBConnection _instance = null;
public static DBConnection Instance()
@ -28,14 +28,34 @@ namespace Articulate
{
if (String.IsNullOrEmpty(DatabaseName))
return false;
string connstring = string.Format("Server={0}; database={1}; UID={2}; password={3}", Server, DatabaseName, UserName, Password);
string connstring = string.Format("Server={0}; database={1}; UID={2}; password={3}; SSL Mode=none", Server, DatabaseName, UserName, Password);
Connection = new MySqlConnection(connstring);
Connection.Open();
}
return true;
}
public void SendCommand(MySqlCommand command)
{
Connection.Open();
command.ExecuteNonQuery();
Connection.Close();
}
public void SendQuery(MySqlCommand query)
{
Connection.Open();
using (MySqlDataReader reader = query.ExecuteReader())
{
}
Connection.Close();
}
public void Close()
{
Connection.Close();