Angel.King.47
Angel.King.47

Reputation: 8004

Datagrid not updating

        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 above code

It runs fine but there is nothing in the datagrid :(

Any help will be apreciated thanks

Upvotes: 3

Views: 589

Answers (1)

Alfred Myers
Alfred Myers

Reputation: 6453

A DataGridView will not work when pointed to a DataSet. You have to point it to a DataTable

Change your code to:


dataGridView1.DataSource = dataset.Tables["call"];

Upvotes: 1

Related Questions