How to count the the number of row in sql table from C#
So I want to access the number of row in sql table...but I should write the code in c#..
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vincent Maverick DuranoPosted May 6, 2015, 11:35 AM
In the second option, Yes replace "MyTable" with the table name from your sql database
Widy GuiPosted May 6, 2015, 10:58 AM
in the first option, do you mean I should make a datagridview to contain the table from sql??
what I want is exactly like the second option..
So I want to ask, Is YourTable is a name of my table in sql??
Vincent Maverick DuranoPosted May 5, 2015, 10:43 AM
But if your intent is just the count and nothing else then you could like this: