public static string GetConnectionString(this MySQLConnectionInfo info) { var cStr = new StringBuilder(); if (Core.Is64Bit) { //cStr.Append(@"Provider=MSDASQL;"); } cStr.AppendFormat("DRIVER={0};", info.Driver.AsConnectionString()); if (info.DSN != null && !String.IsNullOrWhiteSpace(info.DSN.Name)) { cStr.AppendFormat("DSN={0};", info.DSN.Name); } else { cStr.AppendFormat("SERVER={0};", info.IP); cStr.AppendFormat("PORT={0};", info.Port); cStr.AppendFormat("UID={0};", info.User); cStr.AppendFormat("PASSWORD={0};", info.Password); } cStr.Append(@"OPTION=3;"); return(cStr.ToString()); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.GetVersion(); switch (version) { case 1: Persistence = new MySQLConnectionInfo(reader); goto case 0; case 0: MaxConnections = reader.ReadInt(); break; } }
public MySQLOptions() : base(typeof(MySQL)) { MaxConnections = 100; Persistence = new MySQLConnectionInfo("localhost", 3306, "root", "", ODBCVersion.V_5_3_UNICODE); }
public MySQLConnection(MySQLConnectionInfo credentials) { Credentials = credentials; }