how to count number of rows in table ?? RRS feed

  • Question

  • how to count number of rows in table

     Public Shared Function GetALLProjects() As DataSet
            Dim ds As New DataSet()
            Using adapter As New SqlDataAdapter("SELECT * FROM ClientPage_table ", GetConnection)
                adapter.SelectCommand.CommandType = CommandType.Text
            End Using
            Return ds
        End Function

      Dim ds2 As DataSet = CMSProjectSection.GetALLProjects()

    i want to knw the number of enteries  in table

    Thursday, August 2, 2012 5:57 AM


  • Use Count property.

    Dim rowCount As Integer = ds.Tables(0).Rows.Count

    I hope this helps

    Please mark this post as answer if it solved your problem. Happy Programming!

    • Proposed as answer by MasaSam Thursday, August 2, 2012 5:50 PM
    • Marked as answer by SSmadhu Monday, August 6, 2012 5:40 AM
    Thursday, August 2, 2012 6:05 AM