/// <summary> /// Initializes a new instance of <b>SqlBlobStream</b> class for the specified /// Transaction, Table Name, BLOB Data Column, with the specified read/write permission and Primary Keys. /// </summary> /// <param name="Transaction">A sql transaction. The default value is an null.</param> /// <param name="TableName">A table name for the table that the current <b>SqlBlobStream</b> object will encapsulate.</param> /// <param name="BlobDataColumn">A column name for the column that the current <b>SqlBlobStream</b> object will encapsulate.</param> /// <param name="BlobAccess">A <b>SqlBlobAccess</b>constant that gets the CanRead and CanWrite properties of the <b>SqlBlobStream</b> object.</param> /// <param name="PrimaryKeys">A primary keys collection for the row that the current <b>SqlBlobStream</b> object will encapsulate.</param> public SqlBlobStream(SqlTransaction Transaction, string TableName, string BlobDataColumn, SqlBlobAccess BlobAccess, params SqlParameter[] PrimaryKeys) { _transaction = Transaction; _tableName = TableName; _blobColumnName = BlobDataColumn; _blobAccess = BlobAccess; if (PrimaryKeys != null) { foreach (SqlParameter prm in PrimaryKeys) { this.PrimaryKeys.Add(prm); } } Init(); }
public static SqlBlobStream GetMSProjectXMLStream(int projectId, SqlBlobAccess sqlBlobAccess) { SqlTransaction sqlTran = DbContext.Current.Transaction; if (sqlTran != null) { return new SqlBlobStream(sqlTran, "Projects", "MsProjectXml", sqlBlobAccess , new SqlParameter("@ProjectId", projectId)); } else throw new Exception("Transaction is not started"); }
/// <summary> /// Releases the resources used by the SqlBlobStream. /// </summary> /// <param name="disposing">The disposing flag.</param> protected new virtual void Dispose(bool disposing) { this._blobAccess = (SqlBlobAccess)0; this._canSeek = false; this._pointer = null; }
/// <summary> /// Initializes a new instance of <b>SqlBlobStream</b> class for the specified /// Transaction, Table Name, BLOB Data Column, with the specified read/write permission and Primary Keys. /// </summary> /// <param name="Transaction">A sql transaction. The default value is an null.</param> /// <param name="TableName">A table name for the table that the current <b>SqlBlobStream</b> object will encapsulate.</param> /// <param name="BlobDataColumn">A column name for the column that the current <b>SqlBlobStream</b> object will encapsulate.</param> /// <param name="BlobAccess">A <b>SqlBlobAccess</b>constant that gets the CanRead and CanWrite properties of the <b>SqlBlobStream</b> object.</param> /// <param name="PrimaryKeys">A primary keys collection for the row that the current <b>SqlBlobStream</b> object will encapsulate.</param> public SqlBlobStream(SqlTransaction Transaction, string TableName, string BlobDataColumn, SqlBlobAccess BlobAccess, params SqlParameter[] PrimaryKeys) { _transaction = Transaction; _tableName = TableName; _blobColumnName = BlobDataColumn; _blobAccess = BlobAccess; if(PrimaryKeys!=null) { foreach(SqlParameter prm in PrimaryKeys) { this.PrimaryKeys.Add(prm); } } Init(); }