I'm trying to output the result of my SQL query to a div using the InnerHTML. but I can't get more than one record to show up. How do I make it so that all of my records are displayed in the DIV? On my page I have the DIV contained within a UpdatePaneland I only 1 row is displayed even when the query returns more than one row.
string sql = "Select * From Events";
SqlCommand command = new SqlCommand(sql, conn);
command.CommandType = CommandType.Text;
conn.Open();
reader = command.ExecuteReader();
while (reader.Read())
{
divout1.InnerHtml += "Name: " + reader["Name"].ToString() + "<br />" +
"Date: " + reader["Date"].ToString() + "<br />" +
"Location: " + reader["Location"].ToString() + "<br />";
divout.Visible = true;
}