I'm new to using ASP.Net MVC, C#, and Visual Studio. I'm trying to figure out how to make my program go through and count the number of lines saved in its database, but no matter what it just refuses to take any of the different lines of code find online that supposedly count the rows. Currently i'm having the most luck with the line:

int rows = db.DatabaseName.Rows.Count;
This line seems to work for everyone online, but whenever i use it there is an error on ".Rows" that says that the program doesn't contain a definition for 'Rows' and no extension method........"
Please i'm willing to try another method, i just want to get this to work, any help is greatly appreciated, Thanks.