Integration Your Way - (800) 235-7250
RSSBus ADO.NET Provider for SalesForce V2
Questions / Feedback? Calling Stored Procedures

Calling Stored Procedures

You can invoke a stored procedure using SalesForceCommand in the same way as any other SQL stored procedure. To instantiate a SalesForceCommand, provide the name of the stored procedure and a SalesForceConnection instance as arguments to the constructor. Set the CommandType property to StoredProcedure and add the parameters as key-value pairs to the Parameters collection of the SalesForceCommand instance.


string connectionString = "User=myUser;Password=myPassword;Access Token=myToken;Offline=false;";
SalesForceConnection conn = new SalesForceConnection(connectionString);
SalesForceCommand cmd = new SalesForceCommand("SelectEntries", connection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SalesForceParameter("@ObjectName", "Account"));
// Add other parameters as needed ...

SalesForceDataReader rdr = cmd.ExecuteReader();
while (rdr.Read()) {
  for (int i = 0; i < rdr.FieldCount; i++) {
    Console.WriteLine(rdr.GetName(i) + " --> " + rdr[i]);
  }
  Console.WriteLine();
}


 
Copyright © 2013 RSSBus Inc.
[x] close

Questions / Feedback?


Name:
Email:
Feedback:
Send Feedback