Here is the stack trace:
[Exception: [DataConnection.ExecuteQuery]: Query: SELECT * FROM View_CONTENT_BlogPost_Joined WHERE (((((SiteName = N'fcga_eu') AND (Published = 1)) AND (DocumentCulture = N'en-US')) AND (NodeAliasPath LIKE N'/Members-Area/News-Feed/%')) AND (('{%categoryid|(toint)0%}' = 0) OR (DocumentID IN (SELECT DocumentID FROM CMS_DocumentCategory WHERE CategoryID = {%categoryid|(toint)0%} )))) ORDER BY BlogPostDate DESC : caused exception: Incorrect syntax near '?'.]
CMS.DataProviderSQL.DataConnection.ExecuteQuery(String queryText, Object[,] queryParams, QueryTypeEnum queryType) +807
CMS.DataProviderSQL.DataConnection.CMS.IDataConnectionLibrary.IDataConnection.ExecuteQuery(String queryText, Object[,] queryParams, QueryTypeEnum queryType) +13
CMS.DataEngine.GeneralConnection.ExecuteQuery(String queryText, Object[,] parameters, QueryTypeEnum queryType, Boolean transaction) +171
CMS.DataEngine.GeneralConnection.RunQueryObject(Query query, Object[,] parameters) +325
CMS.DataEngine.GeneralConnection.RunQuery(String queryName, Object[,] parameters, String where, String orderBy, Int32 topN, String columns) +83
CMS.DataEngine.GeneralConnection.ExecuteQuery(String queryName, Object[,] parameters, String where, String orderBy, Int32 topN) +21
CMS.TreeEngine.TreeProvider.SelectNodes(String siteName, String aliasPath, String cultureCode, Boolean combineWithDefaultCulture, String classNames, String where, String orderBy, Int32 maxRelativeLevel, Boolean selectOnlyPublished, Int32 topN) +1219
CMS.Controls.CMSAbstractDataProperties.GetDataSet(String path, String where) +1421
CMS.Controls.CMSAbstractDataProperties.LoadData(Object& DataSource, Boolean forceReload) +120
CMS.Controls.CMSRepeater.ReloadData(Boolean forceReload) +1378
CMS.Controls.CMSRepeater.OnInit(EventArgs e) +374
System.Web.UI.Control.InitRecursive(Control namingContainer) +333
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Control.InitRecursive(Control namingContainer) +210
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378
I have some custom user controls and web parts, but I tried disabling them so I don't think that is the problem; however, the problem does seem to be somehow related to ASPX templates:
When I first load my blog page (which uses a portal page template), it works correctly (even without the query string). Then, if I view its parent page (which uses an ASPX template) and go back to the blog, I get this error. The blog page will now give the error on every page load unless I add the categoryid to the query string. If I restart the website in IIS, the blog page will work again until I view the page with the ASPX template.