void AuthorsGridView_RowCreated(Object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Footer)
{
Message.Text = "The authors are:<br>";
// Get the enumerator that contains the data rows in the
// GridView control.
IEnumerator rowEnumerator = AuthorsGridView.Rows.GetEnumerator();
// Iterate though the enumerator and display the value in the
// first cell of the row.
while(rowEnumerator.MoveNext())
{
GridViewRow row = (GridViewRow)rowEnumerator.Current;
Message.Text += row.Cells[0].Text + "<br>";
}
}
}
<!-- This example uses Microsoft SQL Server and connects -->
<!-- to the Pubs sample database. -->
<ASP:SQLDATASOURCE id=AuthorsSqlDataSource runat="server" connectionstring="server=localhost;database=pubs;integrated security=SSPI" selectcommand="SELECT [au_lname], [au_fname] FROM [authors] WHERE [state]='CA'">
</ASP:SQLDATASOURCE>