You need to update the entries in the table in the Postgres subd

I get all the data from the table with the given name table_name,

Table before change

I am changing the data in the table (not necessarily an insert, maybe an update) Table after change

How to update the table in the database if only the table name is known.

There was an idea to make a Merge request, to merge all the records, but it is not clear how to make it. (You can, of course, take and collect a query by column names, but I would like to do better)

Data is stored in DataTable, in Google I did not find how to update the database from this structure.

To work with the database using the library NpgSql

  • one
    How do the data get into a DataTable ? Manually or using DataAdapter / TableAdapter ? If manually, then you also need to do an update yourself: run through the lines, check their version, change the sent to the database. If an adapter is used, then you need to ask it for the correct request in UpdateCommand . - Alexander Petrov
  • @AlexanderPetrov Yes, indeed, with the DataAdapter and CommandBuilder, it was possible to perform an update through the Update from the DataAdapter, after filling out all the requests using the CommandBuilder - Kirya522

0