You need to sign in to do that
Don't have an account?

Bulk api example in C#.net
Hello,
I need bulk api code in C#.net.The developer guide gives the code for client java application.I need it for C#.net.or can i convert the same code to C#.I tried it using IKVM,buit couldnot do it successfully.Please help.
Hi Urvashi,
See the links below, might help,
http://boards.developerforce.com/t5/NET-Development/Bulk-API-Sample-app-using-C/td-p/210918
http://salesforce.stackexchange.com/questions/14740/how-to-perform-upsert-in-salesforce-bulk-api-in-c
http://stackoverflow.com/questions/4326598/connecting-to-salesforce-bulk-api-using-c-sharp
Regards,
Ashish
Hey thanks for the reply.
But i wana convert the bulk api sample client application which is in java(given in bulk api developer guide) to dotnet C#.Has anyone done that.If yes please provide the code along with the jar files converted to dll files.
Hi Urvashi,
The bulk API is rest-based, so all you need to do is write C# code that can send and receive HTTP requests to our servers.
See the links below,
http://boards.developerforce.com/t5/NET-Development/Bulk-API-Sample-app-using-C/td-p/210918
https://github.com/ServiceStack/ServiceStack/wiki/C%23-client
Regards,
Ashish
Hi Urvashi,
Also, See the link below for Integrating with C#.
http://wiki.developerforce.com/page/Integrating_Force.com_with_Microsoft_.NET
C# code for create, update, upsert, query and retrive is in the below links,
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_create.htm
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_update.htm
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_upsert.htm
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_query.htm
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_retrieve.htm
Regards,
Ashish
Hey Ashish thanks a lot for all the links. :)
The project can also be downloaded from Nuget using Install-Package SFBulkAPIStarter.
Please look at my code here
<script type="text/javascript">
function submitPractice() {
webToLead({
oid: '00D20000000l2qZ'
//,debug:1
//, debugEmail: 'gerald@ghanafx.com'
, first_name: $("#PracticeUserDetail_FirstName").val()
, last_name: $("#PracticeUserDetail_LastName").val()
, email: $("#Email").val()
, country_code: $("#PracticeUserDetail_Country").val()
, lead_source: 'web demo'
, description: 'This is an automated transparent lead'
});
//practiceform
var formData = JSON.stringify($("#practiceform").serializeArray());
$.ajax({
type: "POST",
url: "/Account/Practice",
data: formData,
success: function () { },
dataType: "json",
contentType: "application/json"
});
}
function webToLead(fields) {
var customHiddenIframeName='JLA_API';
if(!document.getElementById(customHiddenIframeName)){
var theiFrame=document.createElement("iframe");
theiFrame.id=customHiddenIframeName;
theiFrame.name=customHiddenIframeName;
theiFrame.src='about:blank';
theiFrame.style.display='none';
document.body.appendChild(theiFrame);
}
fields['retURL'] = 'http://166.62.127.6/';//dummy URL
var form = document.createElement("form");
form.method = "POST";
form.action = "https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8";
form.setAttribute("target", customHiddenIframeName);
for (var fieldName in fields) {
var theInput = document.createElement("input");
theInput.name=fieldName;
theInput.value=fields[fieldName];
theInput.setAttribute("type", "hidden");
form.appendChild(theInput);
}
document.body.appendChild(form);
form.submit();
}
</script>