Hi;
How can I get the rows count in a table with Count function in SQL and take it's value as integer??
Printable View
Hi;
How can I get the rows count in a table with Count function in SQL and take it's value as integer??
SELECT Count(*) FROM TableName
Create an SqlCommand with that query and call it's ExecuteScalar method. The Integer value will be returned via an Object reference so you'll have to cast the result.