SharePoint - How to get Document Library Name/Id in managed properties

Asked By Narendra on 16-Jan-12 06:25 AM
Hi All,

I have use fulltextsqlquery to retrive the records in moss 2007 using wsp webpart. I want document library Name to show up or internal use in my program.
Please tell me the solution for this that how can i retrive document library name OR is there any managed property for this?

Thanks in Advance
Narendra Singh
Jitendra Faye replied to Narendra on 16-Jan-12 06:28 AM
A document ID is a unique identifier for a document or document set and a static URL that opens the document or document set associated with the document ID, regardless of the location of the document.


follow this link for steps-

http://blogs.technet.com/b/ptsblog/archive/2011/08/31/sharepoint-2010-returning-document-id-in-search-results.aspx
Riley K replied to Narendra on 16-Jan-12 06:38 AM

I don't think you can easily do it in a single line of code, but the following works with both URLs pointing directly to the document library as well as pointing to a file in that library


using (SPSite site = new SPSite(completeUrl))
{
  using (SPWeb web = site.OpenWeb())
  {
    SPList list = web.GetList(completeUrl);
    string listName = list.Title;
  }
}

Regards