Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, February 23, 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: Retrieving a value to pass in a QueryString from a SQL Query...
Rocky Balboa
Posts: 7
 
Retrieving a value to pass in a QueryString from a SQL Query...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jun 08 5:36 AM
In the "LoadActions" code snippet of a Form, I need to retrieve a specific value from the DB (From an Unrelated Entity). For this, insted of using IQueryable and IExpressionFactory stuff...can I use the .NET ExecuteNonQuery and normal SELECT Statements??
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Retrieving a value to pass in a QueryString from a SQL Query...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Jun 08 1:38 PM
First of all, if you are looking to retreive a value, you would be looking to call the ExecuteScalar rather than an ExecuteNonQuery.

Now, for how to do it, using the Reflector's tool, take a peak at the Sage.SalesLogix.Web.WebUserOptionsService.

Look specifically at the getUserPref and the GetOpenConnection functions.


I am sure tha there are probable more examples out there to be found, but this is one that I know of from recent use.
[Reply][Quote]
Rocky Balboa
Posts: 7
 
Re: Retrieving a value to pass in a QueryString from a SQL Query...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Jun 08 9:02 AM
Im sorry can you give an example to use QueryString in the way your talking about. Im a bit new to Sage Programming.
[Reply][Quote]
Charles
Posts: 11
 
Re: Retrieving a value to pass in a QueryString from a SQL Query...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jun 08 9:42 AM
Not need to pass querystring.you can directly retrieve from database also
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Retrieving a value to pass in a QueryString from a SQL Query...Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jun 08 5:55 PM
While the preferred method for reading and updating the database is to use the entity model, you can if needed create an OleDbConnection to read or update values as well (keep in mind doing so does not make use of entity events and rules).

You'll need to get the Data Service for the portal. From there you can get a connection string, or an OleDbConnection object as well.

Get and use a connection string:

Sage.Platform.Data.IDataService service =       
Sage.Platform.Application.ApplicationContext.Current.Services.Get();

System.Data.OleDbConnection conn = new System.Data.OleDbConnection(service.GetConnectionString());
conn.Open();
//...


or get a connection object:

Sage.Platform.Data.IDataService service =       
Sage.Platform.Application.ApplicationContext.Current.Services.Get();

using(System.Data.IDbConnection conn = service.GetConnection())
{
conn.Open();

System.Data.IDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "select somefield from sometable where somecondition";
object s = cmd.ExecuteScalar().ToString();
//...
}


Got it?
[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): 2/23/2025 5:24:36 PM