I have some ASP.NET code to fetch from my database. The code is as follows:
@{ //begin block
var appDb = Database.Open("apps");
var msg = "hi";
Layout = "~/Header.cshtml";
var queryStr = "SELECT * FROM Apps WHERE appid = '" + @Request.QueryString["id"] + "'";
foreach (var query in appDb.Query(queryStr)) { //begin foreach
<img src="@query.pictureUrl" /><br>
<h2 style="display: inline;"></h2> <h3 style="display: inline;">by </h3>
<p>
</p>
} // end foreach
} // end block
However, WebMatrix says that the //end foreach is the end of the block, not the end of the foreach. It also comes up with this error:
"}" expected at line
<end of file, i'm only copying the errored block but for me it's line 19>
at column 4
So I fix the error, and guess what? It comes up AGAIN. Fix again, appear again and so on.
How do I fix the error