[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

ComboBox DropDownList Problem

Posted on 2006-06-15
3
Medium Priority
?
758 Views
Last Modified: 2008-01-09
Hi

I have a SQL ststement which I run as a SQLCommand and retrieve records to a dataset. I go through the records and add all the WorkOrderId's to the dropdown for the ComboBox. There are 10,000 WorkOrderID's, while it is trying to add the IDs to the dropdown list, the program freezes. The list adds after a while, but on clicking the combobox the takes a while to display the dropdown list.

The SQL statement is

String sSQL = "SELECT OPERATION.WORKORDER_BASE_ID AS WorkOrderID, "+

"WORK_ORDER.PART_ID AS PartID, PART.DESCRIPTION AS PartDesc "+

"FROM OPERATION INNER JOIN WORK_ORDER ON OPERATION.WORKORDER_TYPE = WORK_ORDER.TYPE AND "+

"OPERATION.WORKORDER_BASE_ID = WORK_ORDER.BASE_ID "+

"INNER JOIN "+

"PART ON WORK_ORDER.PART_ID = PART.ID WHERE(SUBSTRING(OPERATION.WORKORDER_TYPE, 1, 1) = 'w') "+

"AND (SUBSTRING(OPERATION.RESOURCE_ID, 1, 1) = '6') "+

"GROUP BY OPERATION.WORKORDER_BASE_ID, "+

"WORK_ORDER.PART_ID, PART.DESCRIPTION "+

"ORDER BY OPERATION.WORKORDER_BASE_ID ";

SqlConnection con = Connection();

SqlCommand comm = new SqlCommand(sSQL, con);

 Code to add the contents of DataSet to ComboBoxEdit(from Developer Express) Dropdown list:

for (int i = 0; i < dsWID.qryWorkOrderID.Count; i++)

{

cboWorkOrderID.Properties.Items.Add(dsWID.qryWorkOrderID.WorkOrderID);

}

Another thing is that I want to bind all the controls and datgridview to a navigator control. But the controls come from three different datasets. And these are dropdownlists. Please provide suggestions as how I can improve the performance. Any suggestions will be appreciated.

Thanks
0
Comment
Question by:phadavid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Expert Comment

by:gemailj
ID: 16913342
try to use stored procedure

it will improve performance
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 1500 total points
ID: 16913698
10,000 items in a combobox is not, in my opinion, a reasonable user interface.  It will take a long time to populate and a long time to render.  The SQL is not the problem here, it is the UI.

Is there any logical groupinbg of the items that would help?
0
 

Author Comment

by:phadavid
ID: 16914295
The 10000 items are for all the WorkOrder ID, i have looked into other controls but the user wants a dropdown list to see previous Work Orders. Coupling this problem with the need for the user needs navigation capabilities along with the dropdown list has made things even more complicated.

I have thought of something but don't know how to implement, i was reading up on t-sql and found Set Rowcount =1000, this helps with the performance problem but i don't know how to display the IDs when the user has reached 1000, there should be some way i can update the comboBox.

Please provide suggestions and tips

Thanks
Ashish
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question