Please suggest which way to dig:

There is a form on it, it shows the results of the query, everything works.

SqlDataAdapter sda = new SqlDataAdapter(); sda.SelectCommand = cmd;//cmd - выполненный результат запроса DataTable dbdataset = new DataTable(); sda.Fill(dbdataset); BindingSource bSource = new BindingSource(); bSource.DataSource = dbdataset; dataGridView1.DataSource = bSource; sda.Update(dbdataset); 

Can anyone give an example, how in Grid (headers and strings) to put data from an object / array? Those. we are talking about the output of simple variables, without being connected to any database / table.

  • Do you want to simply add data to the table without adding it to the database itself? The data is taken from you from the database? - MaximK
  • Yes, just data, and just add to the displayed grid. The code just showed how now (from the database to the displayed grid) - gforce
  • Insert records in the database - Dig in this direction (the first example), but do not save data in the database. - MaximK

0