Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:48:50+00:00 2026-06-09T04:48:50+00:00

The following code displays as it is in browser instead of expected output. I

  • 0

The following code displays as it is in browser instead of expected output. I have the table in sql server 2008. I have this code in webmatrix.

<%@ Page Language="VB" %>
@{
var db = Database.Open("databasename"); 'database name in sql server is 'databasename'
var selectQueryString = "SELECT column_date, sum(qty1) as quantity1, 
sum(qty2) as quantity2, sum(qty3) as quantity3
from tbldaily group by column_date order by column_date"; 
}
<!DOCTYPE html>
<html> 
<body> 
<h1>First table test</h1> 
<table> 
<tr>
<th>at_date</th> 
<th>quantity1</th> 
<th>quantity2</th> 
<th>quantity3</th> 
</tr>
@foreach(var row in db.Query(selectQueryString))
{
<tr> 
<td>@row.column_date</td> 
<td>@row.quantity1</td> 
<td>@row.quantity2</td> 
<td>@row.quantity3</td> 
</tr> 
}
</table> 
</body> 
</html>

I feel there is mistake somewhere in this code. Can you help me to fix this? Please let me know if you want more information regarding my database structure or table that may help to understand my scenario better

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:48:52+00:00Added an answer on June 9, 2026 at 4:48 am

    Looks like you are mixing Razor syntax with WebPages. Name your file *.cshtml and remove the first line which is for WebPages. The rest of your code is valid C# razor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which displays and enables a hidden field if 'Other'
I have a table created with PHP from an Sql Database that successfully displays
Similar to this question , after running the following code the browser dialog does
Gday All, The following code displays a div based on the option that has
I used following code, but it displays only 2 digit of ISO country name.
Using pdfbox displays an error: import java.awt import javax` Based on the following code:
hii every one, following is my code which displays 4 panel one is at
I created a grid of buttons. The following code creates the buttons and displays
I have the following code to display the paragraph of a post, after the
I have the following code to display an image in imagebox using EmgucV: Capture

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.