In this article I am going how to get count of rows and
columns from datatable in asp.net.
Implementation:
I want to know how many rows and columns in datatable or
dataset?
Syntax
C# code
int row = dt.Rows.Count;
int column = dt.Columns.Count;
//dataset
row count
int row =
ds.Tables[0].Rows.Count;
int
column = ds.Tables[0].Columns.Count;
VB.net
code
Dim row As Integer = dt.Rows.Count
Dim column As
Integer
= dt.Columns.Count
‘dataset
row count
Dim row As Integer = ds.Tables(0).Rows.Count
Dim column As
Integer
= ds.Tables(0).Columns.Count
Example:
HTML
Markup of webform