Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, June 30, 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: Loading a combo box with the results of a sql query
Adrian Jones
Posts: 8
 
Loading a combo box with the results of a sql queryYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 May 10 5:18 AM
Hi all,

I'm looking for advice as I'm struggling with why my combo box is not being filled. I'm trying to replicate the functionality from 7.2 LAN in the 7.5.2 web environment whereby the user selects the sales process on the Insert Opportunity screen.
I've created a table and tried to populate it with an adapter that uses my SQL and Connection but I'm evidently missing something
The code compiles ok but the combo box remains blank...

Any help gratefully received.

Thanks
Adrian

my code is below:
Sage.Platform.Data.IDataService service = Sage.Platform.Application.ApplicationContext.Current.Services.Get();
System.Data.DataTable table = new System.Data.DataTable();
string sql = "Select Distinct A1.NAME From PLUGIN A1 Where A1.TYPE = 1 Order By A1.NAME";
using (System.Data.OleDb.OleDbConnection conn = (System.Data.OleDb.OleDbConnection)service.GetConnection())
{
conn.Open();
System.Data.OleDb.OleDbDataAdapter adapter = new System.Data.OleDb.OleDbDataAdapter(sql, conn);
adapter.Fill(table);
}

cboSalesProcess.DataTextField = "Name";
cboSalesProcess.DataValueField = "Name";
cboSalesProcess.DataSource = table;
cboSalesProcess.DataBind();
[Reply][Quote]
Nick Hollis
Posts: 549
Top 10 forum poster: 549 posts
 
Re: Loading a combo box with the results of a sql queryYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 May 10 11:29 AM
Hi,

I would create a SqlConnection (SqlConnection - new SqlConnection() etc), set its connection and commandtext properties (with the sql you provide). Then set the cboSalesProcess datasource to the sqlconnection object you created. Set its data mode to datareader. Set AppendDataBound items to true. Cant think of anything else you need to set (oh must call databind() of course).

Thanks,
Nick
[Reply][Quote]
Adrian Jones
Posts: 8
 
Re: Loading a combo box with the results of a sql queryYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 May 10 3:05 AM
Thanks Nick,

I did try the SQL command also but nothing seemed to fill the combo box....easiest solution seemed to be to create a lookup list and set it to work as a combo box (this seems to work ok).

many thanks again for your help
Adrian
[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/30/2025 1:34:54 PM