简体   繁体   中英

How do I get an auto completion from a database in visual studio ?

I'm trying to make a program, which is basically a shopping list. The purpose is to type something in, while typing the program will fetch items from the database that matches and you will be able to select an item and write a quantity. Later I want to sorts this.

My problem is I have no idea how to make this auto completion thing and I have no idea what I would be searching for, cause I'm sure it's not just called auto completion.

I have programmed a lot with C# in Unity and C++ with console apps and also some java in eclipse. But I have mostly never done anything with visual studio where you are able to design and then program for each item.

http://i.imgur.com/6WXDq.jpg <- heres a picture of what I'm going to make.

I'm not asking anyone to build this for me, I just need to know what I will be searching for to make the first thing work.

I think you'll need something like this:

textBox1.AutoCompleteCustomSource = DataHelper.LoadAutoComplete();
textBox1.AutoCompleteMode = AutoCompleteMode.Suggest;
textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;

In this link there's an example in spanish explaining the autocomplete stuff. Hope it help!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM