Jump to content

DataSource number of rows?

- - - - -

  • Please log in to reply
5 replies to this topic

#1
Hamed

Hamed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 276 posts
I have one data source in default.aspx now I want to know number of rows that I have in database by datasource query in C#.

name of datasource is ds1
what should I type in C# to get number of row that ds1 read from database table.

for example :
if(ds1.numrows == 1)
{
  //do sth
}
what should I type intead of numrows?

#2
l@mbd@

l@mbd@

    Newbie

  • Members
  • PipPip
  • 27 posts
What is *ds1* ? I can tell you with much certainty, it's not a query. A list? A datatable? what?

#3
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
hope this can get you started
http://forums.asp.net/t/1105240.aspx


#4
tjcool

tjcool

    Newbie

  • Members
  • PipPip
  • 18 posts
ds must be an dataset here then try this

ds.Tables[0].Rows.count:

this will give u total no rows in dataset:w00t::w00t:

#5
tjcool

tjcool

    Newbie

  • Members
  • PipPip
  • 18 posts
ds must be an dataset here then try this

ds.Tables[0].Rows.count:

this will give u total no rows in dataset:w00t::w00t:

#6
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
Please don't double post




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users