create the total registered users from database asp.net in sqlserver. [Resolved]

Posted by Dn2010 under ASP.NET on 1/31/2011 | Points: 10 | Views : 2054 | Status : [Member] | Replies : 4
hi friends,

how to create the total registered users from database asp.net in sqlserver.

i want,

no.of users shown,

for example:

suppose registered 25 users.

display like 25.

how to create it.

thanks.




Responses

Posted by: SheoNarayan on: 1/31/2011 [Administrator] HonoraryPlatinum | Points: 50

Up
0
Down

Resolved
As far as I understood your question, you want to get the count of the registered user from your database. Use following SQL statement to execute via ADO.NET (use SqlConnection, SqlCommand) and get the count. In this particular case you will need to use ExecuteScalar() method to get the count.

SELECT Count(AutoId) FROM YourTable


Ganeshji has written an article demonstrating the use of ExecuteScalar today http://www.dotnetfunda.com/articles/article1147-how-to-use-executescalar-method-.aspx use to fire above SQL statement.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 1/31/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Hi,

You can get the count from the database tables as Select Count(ID) from table and use a datareader to get the result and show it

Thanks
Karthik
www.f5Debug.net

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Prabhakar on: 2/1/2011 [Member] [MVP] Starter | Points: 50

Up
0
Down

Resolved
Hi Dn2010

i think you go now in sql data base and run this query

SELECT Count(userid) FROM usermater

it's a use full for u

Best Regard's
Prabhakar

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Dn2010 on: 2/1/2011 [Member] Starter | Points: 25

Up
0
Down
thanks to all............

Dn2010, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response