Showing posts with label DataRow. Show all posts
Showing posts with label DataRow. Show all posts

Monday, April 25, 2011

GridView DataControlRowType

"DataControlRowType Enumeration (System.Web.UI.WebControls)" ( http://bit.ly/fA1sJ6 )

There are several different row types in a Gridview, each with its own function. When using an event such as RowDataBound (where individual rows are of interest to us), it is important to check for the DataControlRowType.

  • Header
  • Footer
  • DataRow
  • Separator
  • Pager
  • EmptyDataRow     

We can do so. The following example checks for a DataRow (a normal row of data):

If e.Row.RowType = DataControlRowType.DataRow Then

    ' Code...

End If

Monday, April 18, 2011

Loop through a DataSet

        Dim dr As DataRow
        Dim dt As DataTable
        dt = DataSetName.Tables(0)
        For Each dr In dt.Rows
           something = dr("FeildName")
        Next