How to insert data from the database into the listbox without pressing any buttons, and when opening the window? When opening this window, the list of materials from the database should be loaded into the form under the text "Material selection"

1 answer 1

  1. We connect Entity Framework for work with a DB
  2. We turn the necessary data set from the table into List / Array
  3. Vesham on Form.Load that he should pull the data sheet out of the database context and draw it

Using the Entity Framework in C ++ Cli

Common problems with connecting the Entity Framework in C ++

Entity Framework Russian-language Guide using .NET

  • In the question there is not a word about the Entity Framework. - Alexander Petrov
  • @AlexanderPetrov user is a new member, MySQL was mentioned in its question, and if so, to give solutions in and out. - Marat Zimnurov
  • one
    The author asks how to make the download when opening the form, without pressing the buttons. Answer "from and to": add the load code to the form constructor, override the OnLoad / OnShown , subscribe to the Load / Shown . And it would be good to give code examples for each variant. - Alexander Petrov
  • one
    Why did you mention only EntityFramework? If we are to suggest ways to work with RDBMS, then describe all the main options: raw ADO.NET (connected and disconnected levels); micro-ORM: massive, petapoco, dapper; large ORM: EF, linq2db, NHibernate ... I call this "from and to". - Alexander Petrov
  • @AlexanderPetrov with this, I agree, my mistake, I will rewrite my answer closer by the evening - Marat Zimnurov