Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, June 7, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Executing a stored procedure
Andrew Grandin
Posts: 272
 
Executing a stored procedureYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 10 5:13 AM
Hi All,

Could someone explain, or show the format of the code, needed to execute a stored procedure in 7.5 web.

I have the Opportunity Details form open in Visual Studio and ive added a link next to the Copy Info to Email link that will exeute a stored procedure in the database.
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Executing a stored procedureYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 10 5:23 AM
p.s this is how i did it in 7.2:

Set cn = CreateObject("ADODB.Connection")
cn.Open Application.GetNewConnection

set cnCmd=CreateObject("ADODB.Command")
cnCmd.ActiveConnection = cn
cnCmd.CommandType = 4
cnCmd.CommandText = "ZSP_ACH_CREATE_PROJECT"
cnCmd.NamedParameters = True

set cnParam=cnCmd.CreateParameter("@slx_key",200,1,12,Application.BasicFunctions.CurrentOpportunityID) cnCmd.Parameters.Append cnParam

set cnInt = cnCmd.Execute
cn.Close 'close connection

set cn=nothing 'set connection object = nothing
set cnCmd=nothing 'set command object = nothing
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Executing a stored procedureYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 10 5:32 AM
Hi there,

Sorry do not have the exact code for SLX but this tutorial should help. Use ADO.NET not CreateObject....

http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson07.aspx

Thanks,

Nick
[Reply][Quote]
Andrew Grandin
Posts: 272
 
Re: Executing a stored procedureYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 10 5:38 AM
very slowly getting there line by line

System.Data.OleDb.OleDbCommand copy = new System.Data.OleDb.OleDbCommand();
copy.CommandType = System.Data.CommandType.StoredProcedure;
copy.CommandText = "ZSP_ACH_CREATE_PROJECT";

just need to figure out how to do the parameters.

Thanks Nick.
[Reply][Quote]
Tony Joanes
Posts: 71
 
Re: Executing a stored procedureYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 May 10 3:33 AM
Try this. I'm using a OleDbDataAdapter here but you can just carry out the required action from the command object (command.ExecuteScalar(); etc)

using (System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connectionString))
{
conn.Open();
using (System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand())
{
try
{
cmd.Connection = conn;
cmd.CommandText = "up_GetUsersContactGroups";
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@userid", userid);

System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(cmd);
da.Fill(result);
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
finally
{
conn.Close();
}
}
}
[Reply][Quote]
ambuenaventura
Posts: 27
 
Re: Executing a stored procedureYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Jul 13 3:38 AM

Thank you Mr. Tony Joanes...  very helpful Cool

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/7/2025 7:00:05 AM