I am hoping someone can help me. I am sure this is quite simple, but I have spent many hours searching for the answer and nothing seems to be working. I have a CSHTML file in Microsoft WebMatrix with Razor/C# code and HTML markup as well as a basic SQL table. I would like to put a dropdown list which displays the results of a SQL query. Below is my code.
@{
var db = Database.Open("QualityMonitoring") ;
var listAgent = "SELECT Agent FROM Data";
}
How do I create a dropdown list to display the results in my markup?
Any help would be greatly appreciated.