Site Jenis Kandungan dalam Penggunaan - Ralat semasa Memadam Jenis Kandungan

Jika anda mendapat “Site Jenis Kandungan dalam Penggunaan” ralat semasa memotong jenis kandungan.

Menukar jenis kandungan lalai untuk senarai / perpustakaan, yang menggunakan jenis kandungan ini.

Kemudian cuba untuk memadam jenis kandungan.

2 komen ke Laman Jenis Kandungan dalam Penggunaan - Ralat semasa Memadam Jenis Kandungan

  • KKelaiya

    Bagaimana untuk mencari di mana pustaka jenis kandungan ini digunakan?

  • Sila rujuk perbincangan dalam forum saya :
    http://www.mstechblogs.com/Forums/viewtopic.php?f=8&p=12&sid=cee7f065bed1fc88d9759c66b373d4dd#p12

    Anda boleh menggunakan Objek Model untuk mencari :

    menggunakan Sistem;
    menggunakan System.Collections.Generic;
    menggunakan Microsoft.SharePoint;

    ruang nama Ujian
    {
    kelas ConsoleApp
    {
    statik tidak sah Utama(rentetan[] argumen)
    {
    menggunakan (SPSite siteCollection = SPSite baru(“http://localhost”))
    {
    menggunakan (SPWeb laman web = siteCollection.OpenWeb())
    {
    // Dapatkan Jenis kandungan yang usang.
    SPContentType obsolete = webSite.ContentTypes[“Test”];

    jika (obsolete != null) // We have a content type.
    {
    IList usages = SPContentTypeUsage.GetUsages(obsolete);
    jika (usages.Count > 0) // It is in use.
    {
    Console.WriteLine(“The content type is in use in the following locations:”);
    foreach (SPContentTypeUsage usage in usages)
    Console.WriteLine(usage.Url);
    }
    else // The content type is not in use.
    {
    // Delete it.
    Console.WriteLine(“Deleting content type {0}…”, obsolete.Name);
    webSite.ContentTypes.Delete(obsolete.Id);
    }
    }
    else // No content type found.
    {
    Console.WriteLine(“The content type does not exist in this site collection.”);
    }
    }
    }
    Console.Write(“\nPress ENTER to continue…”);
    Console.ReadLine();
    }
    }
    }

    Other Option would be using SQL query (beware its bit risky)

    SELECT *
    FROM AllUserData
    WHERE (tp_DirName LIKE ‘%’)
    AND ((tp_ContentType = ‘Document’) and tp_ListId=’C8723B19-0DAB-4F19-B195-3399D5375752′)

    You will find items referenced by content type. Delete this referenced items using query below.

    DELETE
    FROM AllUserData
    WHERE (tp_DirName LIKE ‘%’)
    AND ((tp_ContentType = ‘Document’) and tp_ListId=’C8723B19-0DAB-4F19-B195-3399D5375752′)

Tinggalkan Reply

Anda boleh menggunakan tag HTML ini

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>