示例#1
0
        /// <summary>
        /// Called to Delete a record container.
        /// This call is deep (all records contained are deleted).
        /// </summary>
        /// <param name="name">The name of the container.</param>
        internal FlaimError.Error DeleteContainer(string name)
        {
            FlaimError.Error rc = FlaimError.Error.FERR_OK;
            try
            {
                Query      query   = new Query(name, BaseSchema.CollectionId, SearchOp.Exists, name, Syntax.String);
                IResultSet results = Search(query);
                char []    buffer  = new char[4096];
                int        count;

                while ((count = results.GetNext(ref buffer)) != 0)
                {
                    XmlDocument delDoc = new XmlDocument();
                    delDoc.LoadXml(new string(buffer, 0, count));
                    rc = CommitRecords(name, null, delDoc);
                }
            }
            catch
            {
                if (FlaimError.IsSuccess(rc))
                {
                    rc = FlaimError.Error.FERR_FAILURE;
                }
            }
            return(rc);
        }