“}” Expected error

MiniAcele

New Member
I've been having an issue with using any ASP.NET. I can't even get the simplest program to work without getting an error message (usually about syntax or parentheses/curly braces). For example, this one gives me a \[quote\] CS1513: } expected\[/quote\]error.\[code\]<!DOCTYPE html><html><body>@using System;@{public static void Main(){Console.WriteLine("Hello, world!");}}</body></html> \[/code\]To clarify, this is an attempt to find the source of the error by writing the simplest program I could. I was running into more or less the same problem with the program I was trying before:\[code\]@using System;@using System.Data.SqlClient;@{class Program private static void Main() { SqlConnection connection = new SqlConnection("Data Source=Roar.sdf;Persist Security Info=False;") { connection.Open(); SqlCommand command = new SqlCommand("SELECT Title FROM storyinfo WHERE StoryID = 1", connection) { SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { Console.WriteLine(reader["Title"].ToString()); } reader.Close(); } connection.Close(); } } }\[/code\]
 
Back
Top