Reputation: 1010
The requirment is that the Windows Form Application could access the Lists list so the user can choose the Source List and the Destination List.
I am having a problem accessing the Lists from the site collection. I access the XML of the site by _vti_bin/ListData.svc, here i can get the items of the SPECIFIC LIST.
How do access the Lists list and move the Files?
Here are my codes:
private void setContents(string strSource, string strDestination, string strUser,
string strPW, string strDomain)
{
sourceContent = new SourceSiteDataContext(
new Uri(strSource));
destinationContent = new DestinationSiteDataContext(
new Uri(strDestination));
userContext = new NetworkCredential();
userContext.UserName = strUser;
userContext.Password = strPW;
userContext.Domain = strDomain;
sourceContent.Credentials = userContext;
destinationContent.Credentials = userContext;
}
ArrayList list = new ArrayList();
var sourceQuery = from sourceList in sourceContent.SourceLibrary
select new
{
sourceList.Name
};
foreach (var item in sourceQuery)
{
list.Add(item.Name);
}
private void Form1_Load(object sender, EventArgs e)
{
setContents("http://[site]:[port]/_vti_bin/ListData.svc",
"http://[site]:[port]//sites/DestinationSite/_vti_bin/ListData.svc",
"admin", "admin", "localhost");
setDropDown();
}
the Code here can only take items from a specific list in the code.
Upvotes: 0
Views: 1042
Reputation: 1206
The list services are for pulling information only. To perform changes you will need to use the Sharepoint client object model.
Check MSDN http://msdn.microsoft.com/en-us/library/ee857094%28office.14%29.aspx
Upvotes: 1