Start on QueryBuilder
Created: - MySql Type Name Map - Added String Extensions
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user