Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Copy Name Field to Title Field in a Document Library

$
0
0

Hi guys

This might be a silly question however, I'm a bit stuck.

I need to copy the value of the Name col to the Title col.  I know the code to do this, here is a snippet:

SPWeb topSite = siteCollection.RootWeb;
SPDocumentLibrary docLib = (SPDocumentLibrary)topSite.Lists["DocTest"];
SPListItemCollection items = docLib.Items;

Then foreach it and add something like item["Title"] = item["Name"]

As a console application I can run this on my local machine on my test local SP2010 and it does the job.  The problem is though, I don't know how to run this on our live SP2010?  Where do I put the code?  What type of project to I use in VisualStudio?

VisualStudio is not on our live box so I can't simply run a console app.  I'm new to SP development so don't know where to start really.  I know it's not a webpart so what are my other options.

Is this crazy???

Thanks for any help

David


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>