/// <summary>
        /// Creates a new instance of the <see cref="SqlClientInputStream" /> class for the specified connection string, table
        /// data field, id field, and id value.
        /// </summary>
        /// <param name="connectionString">The connection string of the database to use.</param>
        /// <param name="table">The table in which the data is stored.</param>
        /// <param name="dataField">The field in which the data is stored</param>
        /// <param name="idField">The field which identifies the record.</param>
        /// <param name="idValue">The value which identifies the record.</param>

        /*public SqlClientInputStream(string connectionString, string table, string dataField, string idField, int idValue) :
         *      this(connectionString, table, dataField, idField + "=" + idValue.ToString())
         * {}*/

        /// <summary>
        /// Creates a new instance of the <see cref="SqlClientInputStream" /> class for the specified connection string, table
        /// data field, and where criteria.
        /// </summary>
        /// <param name="connectionString">The connection string of the database to use.</param>
        /// <param name="table">The table in which the data is stored.</param>
        /// <param name="dataField">The field in which the data is stored</param>
        /// <param name="whereCriteria">The where criteria that identifies the record.</param>
        public OracleBlobInputStream(string connectionString, string table, string dataField, string whereCriteria)
        {
            // TODO: add buffering
            _cn = OracleBlobUploadStreamProvider.CreateConnection(connectionString);

            _cmd             = _cn.CreateCommand();
            _cmd.CommandText = "UPDATE " + table + " SET " + dataField + "=:blob WHERE " + whereCriteria;

            _cn.Open();

            object blob = TypeCache.CreateInstance("Oracle.DataAccess.Types.OracleBlob, " + OracleBlobUploadStreamProvider._odpAssembly, new object[] { _cn });

            _blob = new ReflectWrapper(blob);

            _blob.InvokeVoid("BeginChunkWrite");
        }
Esempio n. 2
0
 internal static IDbConnection CreateConnection(string connectionString)
 {
     return((IDbConnection)TypeCache.CreateInstance("Oracle.DataAccess.Client.OracleConnection, " + _odpAssembly, new object[] { connectionString }));
 }