Stange Exception

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
craigd
Posts: 23
Joined: Wed 30 Jan 2013 11:33

Stange Exception

Post by craigd » Sun 10 Mar 2013 04:40

I have received an exception as below produced by the code snippet.
I have checked using the native partner WSDL functions, and there's definitely no field call "WorkspaceId" listed as field, so I don't quite understand why it is being inserted into the query under the hood. I am using 2.2.80
Devart.Data.Salesforce.SalesforceException was unhandled
HResult=-2147467259
Message=
Extension, FederationIdentifier, WorkspaceId, Legal_Entity__c, mkto_si__IsCachingAnonWebActivityList__c
^
ERROR at Row:1:Column:1154
No such column 'WorkspaceId' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
Source=Devart.Data.Salesforce
ErrorCode=-2147467259
Cause=Invalid Field
Code=38
StackTrace:
at Devart.Data.Salesforce.ay.InvokeApiCall[T](Func`1 call)
at Devart.Data.Salesforce.i.a(String A_0, String A_1, FieldInfoCollection A_2)
at Devart.Data.Salesforce.i.a(Object[] A_0)
at Devart.Data.Salesforce.SalesforceCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Data.Salesforce.SalesforceCommand.ExecuteReader()
at Test.Program.Main(String[] args) in d:\Dropbox\Projects\SalesIntelligence\Test\Program.cs:line 74
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

Code: Select all

SalesforceConnectionStringBuilder builder = new SalesforceConnectionStringBuilder();
builder.Host = "login.salesforce.com";
builder.UserId = "xxxxxxxxxxxx";
builder.Password = "xxxxxxxxx";
builder.SecurityToken = "xxxxxxxxxxxxxx";
SalesforceConnection sfConnection = new SalesforceConnection(builder.ConnectionString);
sfConnection.Open();
var cmd = sfConnection.CreateCommand();
cmd.CommandText = "select * from User";
using (var reader = cmd.ExecuteReader())
{
}


Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Stange Exception

Post by Shalex » Tue 12 Mar 2013 17:56

Please try refreshing metadata:

Code: Select all

sfConnection.Open();
sfConnection.Cache.RefreshMetadata();
Does it help?

Post Reply