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

Insert Result of MS SQL query into Custom Object using API & C#/ 2.0

I did not see a sample for this in the QuickStart or C# sample. How do I do this?

I've created a Tab and Custom Object (10 columns of text or numbers) in SalesForce and want to once per day take the results of a MS SQL 2000 query and put them in the Custom Object using C# (2.0). All rows would be replaced, there would not be an update. I have the WSDL with the custom object data.
If there is a sample that shows this, I am sorry that I did not see it and would someone give me a location and name. If there  is not would someone please provide some direction such as the proper API calls to use.
Thank you.
You have to do
1.query all existing rows in salesforce (use the query call)
2. using the ids from (1) delete all the rows (use the delete call)
3. using the ids from (1) remove them all from the recycle bin (emptyRecycleBin call)
4. insert your new data (use the insert call).

This is going to suck like a dog unless you have a very small number of rows, you'd be better of using upsert if at all possible.

There are samples of most of the above calls in the .NET getting started guide.