Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, July 6, 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: Running a custom query in Saleslogix Web 7.5
Johnson Mathew
Posts: 15
 
Running a custom query in Saleslogix Web 7.5Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 May 09 8:54 AM
Can anyone please help me to run custom SQLs and manipulate record sets in a C# Code snippet?
In fact I need to iterate through a set of records and update another table.

Thanks in advance
[Reply][Quote]
Chris Burriss
Posts: 120
 
Re: Running a custom query in Saleslogix Web 7.5Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 May 09 8:56 PM
Mathew,

I haven't worked with Web a lot but my understanding is that you can use ADO.Net (System.Data, System.Data.OleDb, etc.). to do your SQL tasks. Below is an example of retrieving a scalar value. Notice in that the SLX Connection String (SLX OleDB Provider) is being retrieved via the service.GetConnectionString() method, with is a SLX-specific method. Being that this is an OleDB provider, methods from the System.Data.OleDB namespace are being used which is from the standard .Net class libraries. If you look at Microsoft's .Net SDK documentation, you can see there are useful classes such as OleDBCommand, OleDBDataReader, etc.


//Get connection string
string connStr = service.GetConnectionString();
using (System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection(connStr))
{
//Open connection
conn.Open();
using (System.Data.OleDb.OleDbCommand cmd = new System.Data.OleDb.OleDbCommand())
{
//Build and execute SQL
sql = "SELECT USERID FROM USERPROFILE WHERE USERID = '" + curUserID + "'";
cmd.Connection = conn;
cmd.CommandText = sql;
try
{
//If the statements executes then there is a value
yourVal = cmd.ExecuteScalar().ToString();

}
catch
{
//SQL returned a null.

}

Hope this helps.

C. Burriss

[Reply][Quote]
Johnson Mathew
Posts: 15
 
Re: Running a custom query in Saleslogix Web 7.5Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 May 09 7:24 AM
Thanks Burriss, it worked perfect!
[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): 7/6/2025 1:39:22 PM