You need to connect the database (for example, SQL ACESS, but others can also) to the console application. All that could be found at the moment is the connection through the form, and there the ready component is responsible for connecting the "bindingSource".

They also suggested using View -> Other windows -> Data sources -> Database But there is no database in the selection of sources (Visual Studio 2015) enter image description here

  • one
    In my tools menu, there is a point to connect to the database, in which a connection to the required data source is created - Bald
  • 3
    Connect the database from code: support.microsoft.com/ru-ru/kb/306636 - BlackWitcher
  • And if you need to use the database about which the studio does not know? connect manually, it is not as difficult as it seems, the link to the documentation you have already provided, there is everything you need and links to related materials. - rdorn

2 answers 2

I advise you to connect the database manually and interact with them through the micro-ORM. SQL is not so complicated that it would shy away. And the interaction through the micro-ORM gives a fairly convenient interaction with the database so that it would be convenient to interact with the records as with objects.

Personally, I prefer PetaPoco. https://github.com/CollaboratingPlatypus/PetaPoco . It is also quite simple to use, and it has completely open code (even when you import it from a nyuget, the files themselves are imported to you) and in itself is quite fast.

string connectionStr = @"data source=AkinatorDB.sqlite; Version=3;" var a = new System.Data.SQLite.SQLiteConnection(connection); a.Open(); _db = new PetaPoco.Database(a); 

Connects to other types of databases on the same principle.

    View-Server Explorer. In the window that appears, connect to the database. Further, there are many options. 1. Adding a LINQ to SQL class 2. Working with EntityFramework ... These are basic. The easiest and fastest way to start working with a database is to throw LINQ classes. Right-click on a project in the solution browser - Add an existing element - LINQ to SQL classes (On the data tab). After that, add a dbml file by opening it by double clicking in the visual editor, we can add the necessary tables from the database from the server browser.