Salesforce Update

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Cloud Applications
Post Reply
bezpal
Posts: 6
Joined: Tue 21 Nov 2017 17:27

Salesforce Update

Post by bezpal » Tue 21 Nov 2017 17:56

I have downloaded DotConnect for salesforce Trial version.
Using .NET and C# I can read from the salesforce using this code:

Code: Select all

string sql = "SELECT Name, OtherField  FROM MyCustomObject WHERE Name='theName123'"
...
command.ExecuteReader();
However if I try to update it doesn't do anything:

Code: Select all

string sql = "UPDATE MyCustomObject "+
"SET OtherField = 'boo' "+
"WHERE Name='theName123'";
...
command.ExecuteNonQuery();
There is no exception or anything but OtherField is not updated.
Any idea what may be going wrong here?

Thanks you!

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

Re: Salesforce Update

Post by Shalex » Fri 24 Nov 2017 20:16

We cannot reproduce the issue at the moment.

1. Cache is stored in a local SQLite database. It is located in the user Application Data directory (C:\Users\{user name}\AppData\Roaming) by default and is named by the Salesforce.com or Database.com account name. Try removing these *.db files (they will be recreated on next conn.Open()). Does this help?

2. Download, set up, run Fiddler and specify web requests sent when you updating MyCustomObject. For example, the requests in my case ("update dept set loc='12345' where dname='abcd'") are:

Code: Select all

[...]<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><query xmlns="urn:partner.soap.sforce.com"><queryString>SELECT Id FROM Dept__c WHERE Dname__c = 'abcd'</queryString></query></s:Body></s:Envelope>

Code: Select all

[...]<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><update xmlns="urn:partner.soap.sforce.com"><sObjects><type xmlns="urn:sobject.partner.soap.sforce.com">Dept__c</type><Id xmlns="urn:sobject.partner.soap.sforce.com">a0BA000000r0UihMAE</Id><Loc__c xmlns="">12345</Loc__c></sObjects></update></s:Body></s:Envelope>

bezpal
Posts: 6
Joined: Tue 21 Nov 2017 17:27

Re: Salesforce Update

Post by bezpal » Fri 15 Dec 2017 17:21

It started working. I'm not sure what I was doing wrong.
So we bought the license :)

Thank you.

Post Reply