After the declarations, execute the SELECT statement; then add each item from the Data Reader to the ListBox. To identify data from each table you can add a TABLE name as ListBox item at the beginning of the data being displayed.
private void button1_Click(object sender, EventArgs e)
{
Conn.Open();
//Supplier
listBox1.Items.Add("-----Suppliers----");
cmd = new SqlCommand("Select TOP(5) ContactName As PersonName from Suppliers", Conn);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
listBox1.Items.Add(rdr.GetValue(0).ToString());
}
rdr.Close();
//Customers
listBox1.Items.Add("-----Customers----");
cmd = new SqlCommand("Select TOP(5) ContactName As PersonName from Customers", Conn);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
listBox1.Items.Add(rdr.GetValue(0).ToString());
}
rdr.Close();
.
.
.
.
.
}