0

I'm beginning to convert my Access 2007 module to C# so I can deploy it to my SQL Server. Just in step 1, retrieving the lists on the SP server. I had something like it working using VS2005, but things seem to have changed in VS2010. Here's my code...

using System;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Timesheets
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            CPAS_ListSVC.Lists listService = new CPAS_ListSVC.Lists();
            listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            listService.Url = "http://moss.mava.xxxxxx.com/FACSEC/xxxfacilities/XXXCONSTRUCTION/CPAS/_vti_bin/lists.asmx";     // Site
            System.Xml.XmlNode activeItemData = listService.GetListItems("","",null, null, "500", null, "");
            tbXML.Text = activeItemData.ToString();

        }
    }
}

I'm getting an error when I instantiate the variable 'listService'. Compiler says ".lists" is not part of CPAS_ListSVC....

Indeed, Intellisense agrees (what a surprise....) Is there a different class I should be instantiating?

JimS-CLT
  • 665
  • 4
  • 13
  • 30
  • Found the answer: [Another forum user had the same problem...][1] I needed to use a Web Service instead of a standard service. [1]: http://stackoverflow.com/questions/8083689/accessing-sharepoint2007-web-services – JimS-CLT Feb 23 '12 at 18:17

1 Answers1

1

Found the answer:

I needed to use a Web Service instead of a standard service.

JimS-CLT
  • 665
  • 4
  • 13
  • 30