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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 5, 2015, 6:43 AM EDT
But if your intent is just the count and nothing else then you could like this:
Widy Gui4 reputationPosted May 6, 2015, 6:58 AM EDT
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 DuranoRank #238 · 10.3K reputationPosted May 6, 2015, 7:35 AM EDT
In the second option, Yes replace "MyTable" with the table name from your sql database