예제 #1
0
        /// <summary>
        /// Creates a stored procedure statement.
        /// </summary>
        /// <param name="connection">Database connection.</param>
        /// <param name="procedureName">Procedure name.</param>
        /// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
        public PhpSqlDbProcedure(ConnectionResource /*!*/ connection, string /*!*/ procedureName)
            : base("mssql statement", connection)
        {
            if (procedureName == null)
            {
                throw new ArgumentNullException("procedureName");
            }

            this.procedureName = procedureName;
        }
예제 #2
0
파일: FullDb.cs 프로젝트: needlle/C-
        public FullDB(ConnectionResource connectionResource)
            : base(connectionResource.GetStringValue())
        {
            switch (connectionResource)
            {
            case ConnectionResource.LocalMySQL:
                InitLocalMySQL();
                break;

            default:
                break;
            }
        }
        public MysqlDbContext(ConnectionResource connectionResource)
            : base(EnumString.GetStringValue(connectionResource))
        {
            switch (connectionResource)
            {
            case ConnectionResource.APIMYSQL:
                InitDatabaseAsync();
                break;

            case ConnectionResource.LOCALMYSQL:
                InitDatabaseAsync();
                break;

            default:
                break;
            }
        }
예제 #4
0
        /// <summary>
        /// 销毁执行上下文所有相关的资源,并通知追踪器查询已经完成
        /// </summary>
        public virtual void Dispose()
        {
            if (ConnectionResource != null)
            {
                ConnectionResource.Dispose();
            }

            if (SyncRoot != null)
            {
                Monitor.Exit(SyncRoot);
            }

            DataReader.Dispose();

            try
            {
                if (Tracing != null)
                {
                    Tracing.OnComplete();
                }
            }
            catch { }
        }
예제 #5
0
 protected override ResultResource GetResult(ConnectionResource connection, IDataReader reader, bool convertTypes)
 {
     return(new MySqlResultResource(connection, reader, convertTypes));
 }
예제 #6
0
 /// <summary>
 /// Creates an instance of a result resource.
 /// </summary>
 /// <param name="connection">Database connection.</param>
 /// <param name="reader">Data reader from which to load results.</param>
 /// <param name="convertTypes">Whether to convert resulting values to PHP types.</param>
 /// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
 public PhpSqlDbResult(ConnectionResource /*!*/ connection, IDataReader /*!*/ reader, bool convertTypes)
     : base(connection, reader, "mssql result", convertTypes)
 {
     // no code in here
 }
예제 #7
0
파일: Manager.cs 프로젝트: needlle/C-
 public Manager(ConnectionResource connectionResource)
     : base(connectionResource.GetStringValue())
 {
     FullDB initDBIfNotExist = new FullDB(connectionResource);
 }
예제 #8
0
 /// <summary>
 /// Creates an instance of a result resource.
 /// </summary>
 /// <param name="connection">Database connection.</param>
 /// <param name="reader">Data reader from which to load results.</param>
 /// <param name="convertTypes">Whether to convert resulting values to PHP types.</param>
 /// <exception cref="ArgumentNullException">Argument is a <B>null</B> reference.</exception>
 public MySqlResultResource(ConnectionResource /*!*/ connection, IDataReader /*!*/ reader, bool convertTypes)
     : base(connection, reader, "MySQL result", convertTypes)
 {
     // no code in here
 }
예제 #9
0
 /// <summary>
 /// Gets a query result resource.
 /// </summary>
 /// <param name="connection">Database connection.</param>
 /// <param name="reader">Data reader to be used for result resource population.</param>
 /// <param name="convertTypes">Whether to convert data types to PHP ones.</param>
 /// <returns>Result resource holding all resulting data of the query.</returns>
 protected override ResultResource /*!*/ GetResult(ConnectionResource /*!*/ connection, IDataReader /*!*/ reader, bool convertTypes)
 {
     return(new PhpSqlDbResult(connection, reader, convertTypes));
 }