473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Get the document names from document library in sharepoint using C#

I am a newbie to .NET programming. I need to get the names of the
documents in the document library in a particular sharepoint site. Is
the code below correct?
SPSite site = new SPSite("http://server/itteam/rpm");
SPWeb web = site.AllWebs["http://server/itteam/rpm"];

SPDocumentLibrary docLib = (SPDocumentLibrary)web.Lists["Shared
Documents"];
SPListItemCollection items = docLib.Items;
foreach (SPListItem item in items)
{
Console.WriteLine(item.File.Name);
}

I am getting a runtime error as below:

An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll
Additional information: File or assembly name
Microsoft.SharePoint.intl, or one of its dependencies, was not found.

Also I need to know how do I specify the credentials for the server
login in the code. Any help is greatly appreciated.

Thanks.

Sep 13 '06 #1
0 9376

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jorge_Beteta | last post by:
Hello, I work for an attorney staff, so basically the whole day they are sending themselves a lot and a lot of papers (Word docs or Excell sheets). We are going to propose them the use of a...
0
by: hareesh | last post by:
am opening wordapplication object (Have a reference to Microsfot Interop assembly) on the server side in sharepoint document library even handler. I am getting "access is denied" exception. The...
7
by: RA | last post by:
Hi Is there any document management that microsoft provides? A large organization need a tool that gets information and can generate documents based on a pre defined templates. Thanks
4
by: Andrew Robinson | last post by:
This might be more of an IIS question but is there a way of hosting a document (think Word or Excel) within a web site that allows a user to not only download and edit it but also save changes...
1
by: Peter S. | last post by:
There are some files in a Sharepoint document library that I need to access from a C# Webcontrol. The problem is that when the user runs the ASP.NET webpage they will be coming in with a...
0
by: manishahowale | last post by:
Hi, We are developing resume section on our intranet site where all employees resumes will be stored in sharepoint document library in one master format. As we work with different clients, clients...
1
by: tagg3rx | last post by:
Hi all, I'm trying to figure out how to facilitate a window in my web application that will allow users to drag and drop files into it which will inturn trigger the files being uploaded to my...
0
by: BHerz | last post by:
I have an Access 2007 application which displays the File Name of documents located on a Windows SharePoint V3 Site. When you click on the file name the file opens in "Read Only" format. I am not...
2
by: ismailc | last post by:
Good day, I need help. I would like to Update a Sharepoint List (Document Library) Folders using Web Services with Javascript. I have searched on Goggle but nothing that updates a document...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.