Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
 public MySQLOptions()
     : base(typeof(MySQL))
 {
     MaxConnections = 100;
     Persistence    = new MySQLConnectionInfo("localhost", 3306, "root", "", ODBCVersion.V_5_3_UNICODE);
 }
Exemplo n.º 4
0
 public MySQLConnection(MySQLConnectionInfo credentials)
 {
     Credentials = credentials;
 }