Based on your input, I think you want to see some data on the User Interface on button click.
1. Add a DataGridView control on to the Window form, you can leave the name dataGridView1 for now, you can change it later once you got it to work.
2. use the updated code below.
Assumption
1. The connection string is working
2. there are data in the database.
private void button2_Click(object sender, EventArgs e)
{
SqlDataAdapter da = new SqlDataAdapter();
DataTable dt = new DataTable();
da.SelectCommand = new SqlCommand("SELECT name,address,number FROM people ", con);
da.Fill(dt);
con.Close();
dataGridView1.DataSource = dt;
}
How to: Bind Data to the Windows Forms DataGridView Control[
^]