Need example creating a new SharePoint 2010 document and setting attributes

I need an example in .Net (preferably of creating a new document in a SharePoint 2010 document library and setting several custom attributes.

We have to uplaod files to a SP 2010 Doc Library via code and set several attributes on it (actually nearly a dozen custom fields).  We haven't been able to find any code that shows how to do this.
Gene KlamerusTechnical ArchitectAsked:
Who is Participating?
Gene KlamerusTechnical ArchitectAuthor Commented:
I don't see where any of these are examples of creating a document in a document library.
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Gene KlamerusTechnical ArchitectAuthor Commented:
One additional point though, since I need to create new documents (and their metadata/attributes) clearly I'm talking about a .Net desktop application talking ot the SharePoint site.
Gene KlamerusTechnical ArchitectAuthor Commented:
Don't really care about vb vs. C#, but I do have concerns that from what I read the mechanism is different for SP 2010 than it was for SP 2007.
There are many ways of working with Sharepoint. You can use the Sharepoint SDK to directly access the object model or you can use the Webservices to communicate with the server.
Gene KlamerusTechnical ArchitectAuthor Commented:
Also most examples I've found don't show how to do an upload from a desktop (no references to services and the like).

In a nutshell, I've got to write something that will upload files into SharePoint 2010 setting some attributes (fields) on them from data in a spreadsheet.

So I've got to read the spreadsheet (which I can do) and the files (same), but upload the files one at a time into the doc library (which I don't know how to do) from a Windows 7 desktop.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.