Quantcast
Channel: Displaying only active records
Viewing all articles
Browse latest Browse all 16

Re: Displaying only active records

$
0
0

stabes

string com = "select Count(*) from aspnet_Membership where IsApproved = 'IsApproved'";

Yes, that should be completely fine. This would only return the number of users with "Approved" accounts. Additionally, if your IsApproved field is actually a bit (which it should be based on the name), then you would want to use '1' to indicate it was true :

SELECT COUNT(*) FROM aspnet_Membership WHERE IsApproved = 1

Likewise, if you wanted to query and actually pull just those users, you might just use a SELECT * as opposed to the COUNT aggregate :

SELECT * FROM aspnet_Membership WHERE IsApproved = 1


Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>