Question : aspx/c# looping through data from within body

This aspx/c# stuff keeps dogging me as I am now trying to rewrite code so it dynamically lists my data content, but am getting these invalid token errors when attempting to open my database connection as follows:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1519: Invalid token '(' in class, struct, or interface member declaration

Source Error:

Line 61:             myConnection.Open();

Source File: C:\Inetpub\wwwroot\bhhlegal\news2.aspx    Line: 61

see below code as I'm not sure if I have to private some of the code or not
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:

Answer : aspx/c# looping through data from within body

you can add one here is the syntax

this one goes on top of Defauklt.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default3" %>

and this one is the code Default.aspx.cs

public partial class Default3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
     your code here...
    }
}

Random Solutions  
 
programming4us programming4us