function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ralitsa DakovaRalitsa Dakova 

The type or namespace name 'Account' could not be found (are you missing a using directive or an assembly reference?)

Hello,
I'm trying to get a SOAP API to retrieve the details of a certain account/accounts using the IDs I got from getUpdated call. 
My code was working fine until now - here is where I get an error: 

Account retrievedAccount = (Account)arrayIDs[0];

Here is the full (almost) code I have:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SFAPITest.salesforce;
using System.Web.Services.Protocols;
using SFAPITest;


namespace SFAPITest
{
    class Program
    {
        static void Main(string[] args)
        {

            SforceService binding = new SforceService();
            var result = binding.login("username", "pass");
          
            binding.Url = result.serverUrl;

            binding.SessionHeaderValue = new SessionHeader();
            binding.SessionHeaderValue.sessionId = result.sessionId; 

            Console.WriteLine("Server URL: " + result.serverUrl);
            Console.WriteLine("Session ID: " + result.sessionId);

            GetUpdatedResult updatedObj = binding.getUpdated("Account", DateTime.Today, DateTime.Today.AddDays(1)); 

            sObject[] arrayIDs = binding.retrieve("Type", "Account", updatedObj.ids);
            Account retrievedAccount = (Account)arrayIDs[0];

            Console.ReadKey(); 
        }
    }
}


The error is "The type or namespace name 'Account' could not be found (are you missing a using directive or an assembly reference?)"

Please help - have a missed a part of the documentation? I'm using Visual studio 2008 (I know, a little old - will a newer version help?). Just to confirm - I have NOT renamed the project - I see that has been kind of an issue for other users.

Thank you!
Akhil AnilAkhil Anil
Did you recently create a namespace for your organization ? If yes, then you need to prefix the object name with your namespace.
Akhil AnilAkhil Anil
Check this 

https://help.salesforce.com/HTViewHelpDoc?id=register_namespace_prefix.htm&language=en_US
Ralitsa DakovaRalitsa Dakova
OK, I think this may be the thing missing! I am a little slow, but I will look through this! Thank you for your suggestion, Akhil Anil, I will follow up.
Ralitsa DakovaRalitsa Dakova
Unfortunately that turned out not to be the issue. There is something else stopping the Account object from being recognised. Please suggest another solution.
Ralitsa DakovaRalitsa Dakova
Any idieas anyone?
Alexey ZholobovAlexey Zholobov
Hi, Probably your wsdl file were not imported correctly. Try to locate Account via Web Reference Object browser.  In my case that was an issue. I reimported WSDL from local copy (see 4:00 how to use local WSDL  https://www.youtube.com/watch?v=saBtzRXQnv4)