public byte[] GetFileByDbPathName(string dbPathName)
        {
            try
            {
                _sqlDAc = new SqlDataAccess(_connectionString);
                _sqlValues = new Dictionary<string, object>();

                _sqlDAc.BeginTransaction();
                _sqlCommand = "SELECT GET_FILESTREAM_TRANSACTION_CONTEXT()";

                _obj = _sqlDAc.ExecuteBySqlText(SqlDataAccess.ReturnType.Scalar, _sqlCommand, _sqlValues);

                _cxCtx = (byte[])_obj;

                // open the filestream to the blob
                SafeFileHandle handle = OpenSqlFilestream(dbPathName, DESIRED_ACCESS_READ, SQL_FILESTREAM_OPEN_NO_FLAGS, _cxCtx, (UInt32)_cxCtx.Length, 0);

                // open a Filestream to read the blob
                FileStream filestream = new FileStream(handle, FileAccess.Read);

                byte[] buffer = new byte[(int)filestream.Length];
                filestream.Read(buffer, 0, buffer.Length);
                filestream.Close();

                if (handle != null && !handle.IsClosed)
                    handle.Close();

               _sqlDAc.Commit();

                return buffer;
            }
            catch (Exception)
            {
                 _sqlDAc.Rollback();
                throw;
            }
        }