var db = Database.Open("DefaultConnection");
var selectBrands = db.Query("SELECT DISTINCT SubDescription1 AS Brands FROM dbo.Item");
@foreach (var row in selectBrands )
What I want to do is run the sql query within a function in a class. The function will return the data which I am trying to iterate through. I have attached text file with the code.
I get the following error:
Error 19 'object' does not contain a definition for 'Brands' and no extension method 'Brands' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
What I am trying to do is separate markup from logic by setting up classes, is this the right way of going about it?
1. Your Menus class shouldn't implement IEnumerable. You're not enumerating over the class itself, you're enumerating over the collection that one of the methods returns.
2. Your getBrands method returns
Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …