Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7747809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:37:18+00:00 2026-06-01T10:37:18+00:00

I have a combobox that is filled with data field JobCode from database. There

  • 0

I have a combobox that is filled with data field JobCode from database. There are 1000s of jobcode and when the user needs to select one jobcode he has to scroll down through all the jobcodes in the combobox. Can I do it in such a way that if the user types some letter of jobcode it will show the jobcodes which start with that letter in the combobox at the top of list so the user can select easily. For example, like adding some code in keypressevent in combobox.

The user must still choose from jobcodes in the list, not keep partially or incorrectly entered data that will cause wrong data entry at insert and update time.

public void jobcomboboxload()
{
       OleDbConnection oleDbConnection1 = new System.Data.OleDb.OleDbConnection(connString);
       oleDbConnection1.Open();
       OleDbCommand oleDbCommand1 = new System.Data.OleDb.OleDbCommand("Select jobpk,jobcode from  jobcodemastertable", oleDbConnection1);
       OleDbDataReader reader = oleDbCommand1.ExecuteReader();
       DataTable dt = new DataTable();
       dt.Columns.Add("jobpk", typeof(int));
       dt.Columns.Add("jobcode", typeof(string));
       dt.Load(reader);
       cmbjobcode.ValueMember = "jobpk";
       cmbjobcode.DisplayMember = "jobcode";
       cmbjobcode.DataSource = dt.DefaultView;

       oleDbConnection1.Close();
   }

jobcode is an unique field.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:37:20+00:00Added an answer on June 1, 2026 at 10:37 am
    • Use cmbjobcode.AutoCompleteMode = AutoCompleteMode.Suggest (or other
      values of the enum)
    • Use cmbjobcode.AutoCompleteSource = AutoCompleteSource.ListItems
    • Change your query including the clause ORDER BY on the field jobcode

    Please, don’t forget the using statement around your OleDbConnection, OleDbCommand and OleDbDataReader. This will assure the proper dispose of the before mentioned variables.

    For the checking on incomplete values, you should add the Validating event and, in that event, check if the text entered is present in your strings.
    The combobox has a method called FindStringExact() that can help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have ComboBox that takes data from another class public partial class MainWindow :
My combobox in c# windows forms is filled with data from my database... Display
At the moment I have a combobox that is populated from the name fields
I have this ArrayCollection filled with a xml data coming from and HttpService request.
I have a ComboBox that has an associated ErrorProvider in the user control it
I have a Silverlight application with a ComboBox that is filled by VideoCaptureDevice 's.
I have a combobox that I disable when user clicks on checkbox with this:
I have a combobox that is populated at runtime with values from a loadoperation
I have a ComboBox that list out available COM ports. If there are new
Currently I have a comboBox that reads information from outlook, and stores a list

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.