S
S
Svyatoslav Nemato2020-04-23 20:17:38
C++ / C#
Svyatoslav Nemato, 2020-04-23 20:17:38

Working with a large number of components on a form?

[Not so long ago I began to learn C #]

C #, such elements as ComboBox, have a DataSource property where I can specify a table from the database and the data from this table will be in the ComboBox.
But when there are many such ComboBoxes on the form and each of them refers to different tables, problems begin.

1. When editing data, I must compare the data from the database with the ComboBox data, and
I do it like this

ComboBox.SelectedValue = data // где data переменная содержащая данные из бд.

as I understand it, because of this, each ComboBox still makes a request to the database and therefore the form opens for a long time (1-2 seconds)

Actually, the question itself is how to correctly transfer data from the database to such ComboBoxes for further editing, without losing the speed of the form (so that the form opens quickly).

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question