Datagrid does not update

        con.Open();
        MySqlDataAdapter adapter = new MySqlDataAdapter("SELECT * FROM `call`", con);
        DataSet dataset = new DataSet();
        adapter.Fill(dataset, "call");

        dataGridView1.DataSource = dataset;
        dataGridView1.Update();

Here is the code above

It works fine, but there is nothing in the datagrid :(

Any help would be appreciated thanks

+3
source share
1 answer

DataGridView will not work if you point to a DataSet. You must point it to a DataTable

Change your code to:


dataGridView1.DataSource = dataset.Tables["call"];
+1
source

Source: https://habr.com/ru/post/1715281/


All Articles